From d8aff6f4db9bcb7810f7f0761fc4b25dc0eac1dd Mon Sep 17 00:00:00 2001 From: eti Date: Tue, 13 Oct 2026 00:35:51 +0200 Subject: [PATCH] web/components: render one commit row tree per breakpoint Signed-off-by: eti --- web/src/lib/components/repo/CommitRow.svelte | 113 +++++++------------ 1 file changed, 38 insertions(+), 75 deletions(-) diff --git a/web/src/lib/components/repo/CommitRow.svelte b/web/src/lib/components/repo/CommitRow.svelte index da84896df..ee4a45d76 100644 --- a/web/src/lib/components/repo/CommitRow.svelte +++ b/web/src/lib/components/repo/CommitRow.svelte @@ -18,33 +18,8 @@ import type { CommitSummary } from "$lib/components/repo/types"; import { tv } from "tailwind-variants"; - const subjectLayout = tv({ - slots: { - wrapper: "min-w-0", - link: "text-foreground-default no-underline hover:underline", - signOff: "", - bodyToggle: "" - }, - variants: { - wrap: { - true: { - wrapper: "space-x-xs", - link: "wrap-break-word", - signOff: "align-middle", - bodyToggle: "inline-flex align-middle" - }, - false: { - wrapper: "flex items-center gap-xs", - link: "truncate", - signOff: "", - bodyToggle: "" - } - } - } - }); - const row = tv({ - base: "px-md md:col-span-full md:grid md:grid-cols-subgrid md:grid-rows-[minmax(3rem,auto)] md:items-center" + base: "grid grid-cols-[minmax(0,max-content)_max-content_max-content_1fr] items-center gap-1 p-4 max-md:text-foreground-muted md:col-span-full md:grid-cols-subgrid md:grid-rows-[minmax(3rem,auto)] md:gap-x-[normal] md:gap-y-0 md:py-0" }); interface Props { @@ -75,8 +50,8 @@ const hasBody = $derived(hasBodyBeyondSignOffs(commit.body)); -{#snippet author()} - +{#snippet author(extra = "")} + {#if commit.authorHandle} {:else if commit.authorName && commit.authorEmail && !commit.authorDid} @@ -124,20 +99,23 @@ {/snippet} -{#snippet subject(wrap = false)} - {@const s = subjectLayout({ wrap })} - - +{#snippet subject()} + + {commit.subject} {#if signOffs.length > 0} - + {/if} {#if hasBody} (expanded = !expanded)} - class={s.bodyToggle()} + class="inline-flex align-middle md:inline-block" /> {/if} {#if tagsByCommit} @@ -149,9 +127,7 @@ {/each} {/if} - {#if wrap} - {@render pipeline("min-h-0 inline-flex align-middle", "small")} - {/if} + {@render pipeline("min-h-0 inline-flex align-middle md:hidden", "small")} {/snippet} @@ -177,18 +153,11 @@ {/snippet} -{#snippet body(extra = "")} - {#if hasBody && expanded} -

- {commit.body} -

- {/if} -{/snippet} - {#snippet when()} - + {/snippet}
- -- 2.54.0