From 3175b27e2edb3f7260bceaf294eaa2a36cc075ae Mon Sep 17 00:00:00 2001 From: eti Date: Wed, 2 Sep 2026 23:52:42 +0200 Subject: [PATCH] web: use Card for the hand-rolled card surfaces Signed-off-by: eti --- .../lib/components/comment/CommentBox.svelte | 5 +++-- web/src/lib/components/repo/Readme.svelte | 7 +++--- .../lib/components/repo/RepoForkForm.svelte | 5 +++-- .../pulls/PullCommitListDiff.stories.svelte | 11 +++++----- .../pulls/PullCommitListHeader.stories.svelte | 17 ++++++-------- .../PullCommitListInterdiff.stories.svelte | 7 ------ .../repo/pulls/PullCompose.stories.svelte | 22 ++++++++++++------- .../components/search/CodeResultCard.svelte | 7 +++--- .../[version]/[[range]]/PullViewPage.svelte | 13 +++++------ web/src/routes/repo/new/+page.svelte | 5 +++-- 10 files changed, 46 insertions(+), 53 deletions(-) diff --git a/web/src/lib/components/comment/CommentBox.svelte b/web/src/lib/components/comment/CommentBox.svelte index 89c92c4bb..363db47f4 100644 --- a/web/src/lib/components/comment/CommentBox.svelte +++ b/web/src/lib/components/comment/CommentBox.svelte @@ -2,6 +2,7 @@ import MessageSquarePlus from "$icon/message-square-plus"; import Reply from "$icon/reply"; import { type MarkupContext } from "$lib/markup"; + import Card from "$lib/components/ui/Card.svelte"; import CommentEditor from "./CommentEditor.svelte"; import type { ThreadInput } from "./comments"; @@ -63,7 +64,7 @@ {@render editor()} {:else} -
+ {@render editor()} -
+ {/if} diff --git a/web/src/lib/components/repo/Readme.svelte b/web/src/lib/components/repo/Readme.svelte index 02a455fa6..7c6e6919d 100644 --- a/web/src/lib/components/repo/Readme.svelte +++ b/web/src/lib/components/repo/Readme.svelte @@ -1,5 +1,6 @@ -
+
{/if} -
+ diff --git a/web/src/lib/components/repo/RepoForkForm.svelte b/web/src/lib/components/repo/RepoForkForm.svelte index 00837cfdf..8e2369ef0 100644 --- a/web/src/lib/components/repo/RepoForkForm.svelte +++ b/web/src/lib/components/repo/RepoForkForm.svelte @@ -1,6 +1,7 @@ {#snippet frame(args: Props)} -
+ -
+ {/snippet} @@ -89,9 +90,7 @@ {#snippet template(args)} -
+ picked v{picked.start}..v{picked.end} -
+ {/snippet}
diff --git a/web/src/lib/components/repo/pulls/PullCommitListHeader.stories.svelte b/web/src/lib/components/repo/pulls/PullCommitListHeader.stories.svelte index da42127f9..ce99dd1d9 100644 --- a/web/src/lib/components/repo/pulls/PullCommitListHeader.stories.svelte +++ b/web/src/lib/components/repo/pulls/PullCommitListHeader.stories.svelte @@ -4,6 +4,7 @@ import PullCommitListHeader from "./PullCommitListHeader.svelte"; import IterationCcw from "$icon/iteration-ccw"; import Button from "$lib/components/ui/Button.svelte"; + import Card from "$lib/components/ui/Card.svelte"; import type { CommitSummary } from "$lib/components/repo/types"; import type { PullSubmission } from "$lib/api"; @@ -73,9 +74,9 @@ {#snippet frame(args: Props)} -
+ -
+ {/snippet} @@ -94,15 +95,13 @@ {#snippet template(args)} -
+ {#snippet actions()} {/snippet} -
+ {/snippet}
@@ -117,9 +116,7 @@ {#snippet template(args)} -
+ -
+ {/snippet}
diff --git a/web/src/lib/components/repo/pulls/PullCommitListInterdiff.stories.svelte b/web/src/lib/components/repo/pulls/PullCommitListInterdiff.stories.svelte index 95271e9b2..5cedf28db 100644 --- a/web/src/lib/components/repo/pulls/PullCommitListInterdiff.stories.svelte +++ b/web/src/lib/components/repo/pulls/PullCommitListInterdiff.stories.svelte @@ -80,13 +80,6 @@ {/snippet}
- - - {#snippet template(args)} - {@render frame(args)} - {/snippet} - - { const canvas = within(canvasElement); - const trigger = canvas.getByRole("button", { name: /open as alice/i }); - await expect(trigger).toBeInTheDocument(); - await userEvent.click(trigger); - await userEvent.click(await canvas.findByRole("menuitem", { name: /bob/i })); - // the story's bobbin is fake, the diverged refetch fails and the fork - // lane falls back to its empty state - await canvas.findByText(/select a fork first/i, {}, { timeout: 5000 }); - await expect(canvas.getByRole("button", { name: /open as bob/i })).toBeInTheDocument(); + const originalFetch = window.fetch; + window.fetch = (async () => new Response(null, { status: 404 })) as typeof fetch; + try { + const trigger = canvas.getByRole("button", { name: /open as alice/i }); + await expect(trigger).toBeInTheDocument(); + await userEvent.click(trigger); + await userEvent.click(await canvas.findByRole("menuitem", { name: /bob/i })); + // the story's bobbin is fake, the diverged refetch fails and the fork + // lane falls back to its empty state + await canvas.findByText(/select a fork first/i); + await expect(canvas.getByRole("button", { name: /open as bob/i })).toBeInTheDocument(); + } finally { + window.fetch = originalFetch; + } }} > {#snippet template(args)} diff --git a/web/src/lib/components/search/CodeResultCard.svelte b/web/src/lib/components/search/CodeResultCard.svelte index 52a228eaf..a4271bc2e 100644 --- a/web/src/lib/components/search/CodeResultCard.svelte +++ b/web/src/lib/components/search/CodeResultCard.svelte @@ -4,6 +4,7 @@ import Star from "$icon/star"; import type { FileResult } from "$lib/api/lexicons/types/org/tangled/temp/search/searchCode"; import { formatCount } from "$lib/format"; + import Card from "$lib/components/ui/Card.svelte"; import FileMatch from "./FileMatch.svelte"; let { result }: { result: FileResult } = $props(); @@ -12,9 +13,7 @@ const branches = $derived(result.branches ?? []); -
+
-
+
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 76a13bfb9..ee2413974 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 @@ -34,6 +34,7 @@ import { renderMarkup } from "$lib/markup"; import RepoTabs from "$lib/components/repo/RepoTabs.svelte"; import Ticket from "$lib/components/repo/tickets/Ticket.svelte"; + import Card from "$lib/components/ui/Card.svelte"; import TabPanel from "$lib/components/ui/TabPanel.svelte"; import type { ResolvedPathname } from "$app/types"; import type { Did } from "@atcute/lexicons/syntax"; @@ -519,9 +520,7 @@ {#if pull.versions.length} -
+ {/if} -
+ {:else} -
+

This pull request has no versions submitted yet.

@@ -585,7 +582,7 @@ {/if} -
+ {/if} diff --git a/web/src/routes/repo/new/+page.svelte b/web/src/routes/repo/new/+page.svelte index c5bd3b689..57c89ddfb 100644 --- a/web/src/routes/repo/new/+page.svelte +++ b/web/src/routes/repo/new/+page.svelte @@ -1,6 +1,7 @@