diff --git a/web/src/lib/api/repo.ts b/web/src/lib/api/repo.ts index d804a360..b47d9ef5 100644 --- a/web/src/lib/api/repo.ts +++ b/web/src/lib/api/repo.ts @@ -126,9 +126,6 @@ export const splitMessage = (message: string): [string, string] => { return [message.slice(0, separator).trim(), message.slice(separator + 2).trim()]; }; -/** the subject is the first paragraph, not the first line */ -export const subjectOf = (message: string): string => splitMessage(message)[0]; - const coAuthorPattern = /^Co-authored-by:\s*(.+?)\s*<([^>]+)>/gim; // trailers carry no date of their own, like types/commit.go every diff --git a/web/src/lib/components/repo/FileTree.svelte b/web/src/lib/components/repo/FileTree.svelte index cb6171c4..199595f3 100644 --- a/web/src/lib/components/repo/FileTree.svelte +++ b/web/src/lib/components/repo/FileTree.svelte @@ -4,9 +4,10 @@ import FileSymlink from "$icon/file-symlink"; import Folder from "$icon/folder"; import FolderInput from "$icon/folder-input"; - import { subjectOf } from "$lib/api/repo"; + import { splitMessage } from "$lib/api/repo"; import TimeAgo from "$lib/components/ui/TimeAgo.svelte"; import type { TreeEntrySummary } from "./types"; + import { encodePathSegments } from "./urls"; interface Props { ownerHandle: string; @@ -25,7 +26,7 @@ const linkFor = (entry: TreeEntrySummary) => { const target = path ? `${path}/${entry.name}` : entry.name; const kind = entry.kind === "directory" ? "tree" : "blob"; - return `${base}/${kind}/${encodedRef}/${target}`; + return `${base}/${kind}/${encodedRef}/${encodePathSegments(target)}`; }; // lucide puts fill="none" on the path itself, which beats anything inherited @@ -71,7 +72,7 @@ href={resolve(`${base}/commit/${entry.lastCommitHash}` as "/")} class="block truncate text-foreground-subtle no-underline hover:underline" > - {subjectOf(entry.lastCommitMessage)} + {splitMessage(entry.lastCommitMessage)[0]} {/if} diff --git a/web/src/lib/components/repo/LastCommitPanel.svelte b/web/src/lib/components/repo/LastCommitPanel.svelte index e5f1d6a4..0d277a6c 100644 --- a/web/src/lib/components/repo/LastCommitPanel.svelte +++ b/web/src/lib/components/repo/LastCommitPanel.svelte @@ -1,5 +1,6 @@ - + + {@render repoActions("mt-2 grid grid-cols-2 items-center gap-2 sm:hidden")} diff --git a/web/src/lib/components/repo/RepoIndexView.svelte b/web/src/lib/components/repo/RepoIndexView.svelte index bac0b764..2b38f90a 100644 --- a/web/src/lib/components/repo/RepoIndexView.svelte +++ b/web/src/lib/components/repo/RepoIndexView.svelte @@ -72,7 +72,7 @@ />
-
+
-