diff --git a/web/src/lib/components/repo/pulls/PullCommitList.stories.svelte b/web/src/lib/components/repo/pulls/PullCommitList.stories.svelte index d99d8c6f6..51fd7dc9f 100644 --- a/web/src/lib/components/repo/pulls/PullCommitList.stories.svelte +++ b/web/src/lib/components/repo/pulls/PullCommitList.stories.svelte @@ -98,7 +98,10 @@ {/snippet} - + commit.authorName === "oppi") }} +> {#snippet template(args)} {@render frame(args)} {/snippet} diff --git a/web/src/lib/components/repo/pulls/PullCommitList.svelte b/web/src/lib/components/repo/pulls/PullCommitList.svelte index 9b6119caa..804d186e9 100644 --- a/web/src/lib/components/repo/pulls/PullCommitList.svelte +++ b/web/src/lib/components/repo/pulls/PullCommitList.svelte @@ -18,11 +18,10 @@ interface Props { commits: CommitSummary[]; pipelineStatuses?: Promise; - showChangeIds?: boolean; selection: PullCommitSelection; } - let { commits, pipelineStatuses, showChangeIds = true, selection }: Props = $props(); + let { commits, pipelineStatuses, selection }: Props = $props(); // where row `i` sits inside a range, so the row can style its own ends function band(i: number, { start, end }: Range): Band { @@ -47,14 +46,17 @@ const allSelected = $derived(selected < 0); + const authors = $derived(commits.map((commit) => commit.authorDid ?? commit.authorName)); + const showAvatars = $derived(authors.some((author) => author !== authors[0])); + let palette = $derived( allSelected - ? "--range-accent: var(--color-foreground-placeholder); --range-fill: var(--color-background-subtle)" - : "--range-accent: var(--color-background-info-emphasis); --range-fill: var(--color-background-info-subtle)" + ? "--range-accent: var(--color-foreground-placeholder); --range-fill: var(--color-background-inset); --range-mid: var(--color-background-muted)" + : "--range-accent: var(--color-background-info-emphasis); --range-fill: var(--color-background-info-subtle); --range-mid: var(--color-background-info-subtle-hover)" ); -{#snippet rangeRow(i: number, item: CommitSummary | "base", actions: RowActions)} +{#snippet rangeRow(_i: number, item: CommitSummary | "base", actions: RowActions)} {#if item === "base"}
- Base + Base
{:else} - + {/if} {/snippet} @@ -146,8 +142,7 @@ diff --git a/web/src/lib/components/repo/pulls/PullCommitListHeader.svelte b/web/src/lib/components/repo/pulls/PullCommitListHeader.svelte index 4c67af29a..533d7cb13 100644 --- a/web/src/lib/components/repo/pulls/PullCommitListHeader.svelte +++ b/web/src/lib/components/repo/pulls/PullCommitListHeader.svelte @@ -13,39 +13,19 @@ versions: PullSubmission[]; commits: CommitSummary[]; versionRange: Range; - showChangeIds?: boolean; oncommitVersions: (range: Range) => void; actions?: Snippet; } - let { - versions, - commits, - versionRange, - showChangeIds = $bindable(true), - oncommitVersions, - actions - }: Props = $props(); + let { versions, commits, versionRange, oncommitVersions, actions }: Props = $props(); const isInterdiff = $derived(versionRange.start != versionRange.end); - const hasChangeIds = $derived(commits.some((commit) => commit.changeId !== undefined));
- {#if hasChangeIds} - - {:else} - Commits - {/if} + Commits {commits.length} {#if isInterdiff} Interdiff diff --git a/web/src/lib/components/repo/pulls/PullCommitRow.svelte b/web/src/lib/components/repo/pulls/PullCommitRow.svelte index 591bc17bb..970d28a36 100644 --- a/web/src/lib/components/repo/pulls/PullCommitRow.svelte +++ b/web/src/lib/components/repo/pulls/PullCommitRow.svelte @@ -6,15 +6,13 @@ import Avatar from "$lib/components/ui/Avatar.svelte"; import Link from "$lib/components/ui/Link.svelte"; import Separator from "$lib/components/ui/Separator.svelte"; - import Tag from "$lib/components/ui/Tag.svelte"; import PipelineWorkflows from "$lib/components/repo/pipelines/PipelineWorkflows.svelte"; import type { CommitSummary } from "$lib/components/repo/types"; interface Props { commit: CommitSummary; pipelineStatuses?: Promise; - highlight?: boolean; - showChangeId?: boolean; + showAvatar?: boolean; onclick?: () => void; onpointerenter?: () => void; onpointerleave?: () => void; @@ -23,50 +21,35 @@ let { commit, pipelineStatuses, - highlight = false, - showChangeId = true, + showAvatar = true, onclick, onpointerenter, onpointerleave }: Props = $props(); let expanded = $state(false); - let flipped = $state(false); - const short = (id: string) => id.slice(0, 8); - - const swappable = $derived(commit.changeId !== undefined); - const asChange = $derived(swappable && showChangeId !== flipped); - const label = $derived(asChange && commit.changeId ? short(commit.changeId) : commit.shortHash); + const changeId = $derived(commit.changeId?.slice(0, 8)); -
-
-
- {#if swappable} - - {:else} - - {label} - - {/if} -
-
+
+ + {commit.shortHash} + + + {changeId ?? ""} + +
+ {#if showAvatar} {#if commit.authorHandle && commit.authorDid} {/if} - {commit.subject} - {#if commit.body} - (expanded = !expanded)} /> - {/if} -
- - {#if commit.body && expanded} -
{commit.body}
+ {/if} + {commit.subject} + {#if commit.body} + (expanded = !expanded)} /> {/if}
-
+
{#if pipelineStatuses} {#await pipelineStatuses then statuses} {#if statuses[commit.hash]} @@ -112,4 +90,8 @@
{/if}
+ {#if commit.body && expanded} +
{commit.body}
+ {/if}
diff --git a/web/src/routes/[handle]/[repo]/pulls/[aturi]/[version]/[[range]]/PullViewPage.svelte b/web/src/routes/[handle]/[repo]/pulls/[aturi]/[version]/[[range]]/PullViewPage.svelte index ef6a4ac3f..fcb3c5b9a 100644 --- a/web/src/routes/[handle]/[repo]/pulls/[aturi]/[version]/[[range]]/PullViewPage.svelte +++ b/web/src/routes/[handle]/[repo]/pulls/[aturi]/[version]/[[range]]/PullViewPage.svelte @@ -348,7 +348,6 @@ let discussionOpen = $state(true); let discussionWidth = $state(336); - let showChangeIds = $state(true); let formHeight = $state(0); const insertComment = async (body: string, commit?: string) => { @@ -669,7 +668,6 @@ versions={pull.versions} {commits} {versionRange} - bind:showChangeIds oncommitVersions={confirmVersions} > {#snippet actions()} @@ -697,7 +695,6 @@