From 488ba7c829fe92283136309db8debc2f7fd1686f Mon Sep 17 00:00:00 2001 From: eti Date: Sat, 19 Sep 2026 03:05:31 +0200 Subject: [PATCH] web/repo: rescale repo, tree and commit views Signed-off-by: eti --- web/src/lib/components/repo/BlobHeader.svelte | 26 +++--- web/src/lib/components/repo/BlobView.svelte | 14 ++-- web/src/lib/components/repo/BranchList.svelte | 10 ++- .../lib/components/repo/BranchTable.svelte | 26 +++--- .../lib/components/repo/CloneDropdown.svelte | 22 ++--- .../components/repo/CommitBodyToggle.svelte | 4 +- .../lib/components/repo/CommitHeader.svelte | 10 +-- web/src/lib/components/repo/CommitList.svelte | 8 +- .../lib/components/repo/CommitLogView.svelte | 20 ++--- web/src/lib/components/repo/CommitRow.svelte | 71 ++++++++++------ web/src/lib/components/repo/CommitRows.svelte | 2 +- .../lib/components/repo/CommitSignOff.svelte | 8 +- web/src/lib/components/repo/CommitView.svelte | 8 +- .../lib/components/repo/DiffCodeView.svelte | 2 +- .../lib/components/repo/DiffFileHeader.svelte | 4 +- .../lib/components/repo/DiffFileTree.svelte | 10 +-- .../lib/components/repo/DiffStatPill.svelte | 8 +- web/src/lib/components/repo/DiffView.svelte | 80 +++++++++++++------ web/src/lib/components/repo/EmptyRepo.svelte | 18 ++--- .../lib/components/repo/FileCardHeader.svelte | 4 +- .../components/repo/FileHistoryView.svelte | 24 +++--- .../lib/components/repo/FilePathChip.svelte | 2 +- web/src/lib/components/repo/FileTree.svelte | 8 +- .../components/repo/LabelPanel.stories.svelte | 12 +-- web/src/lib/components/repo/LabelPanel.svelte | 14 ++-- .../lib/components/repo/LanguageBar.svelte | 10 ++- .../components/repo/LastCommitPanel.svelte | 6 +- .../lib/components/repo/PanelHeader.svelte | 10 +-- web/src/lib/components/repo/Readme.svelte | 12 +-- web/src/lib/components/repo/RefChip.svelte | 2 +- .../lib/components/repo/RefSelector.svelte | 8 +- .../components/repo/RepoCard.stories.svelte | 27 +++++-- web/src/lib/components/repo/RepoCard.svelte | 12 +-- .../components/repo/RepoCardContent.svelte | 28 ++++--- .../components/repo/RepoCreationForm.svelte | 32 ++++---- .../lib/components/repo/RepoForkForm.svelte | 10 +-- web/src/lib/components/repo/RepoHeader.svelte | 28 +++---- .../lib/components/repo/RepoIndexView.svelte | 22 ++--- .../components/repo/RepoReadmeSkeleton.svelte | 2 +- .../lib/components/repo/RepoToolbar.svelte | 6 +- .../repo/StarredBy.bones.stories.svelte | 2 +- web/src/lib/components/repo/StarredBy.svelte | 2 +- .../components/repo/StarredByContent.svelte | 4 +- web/src/lib/components/repo/TagCard.svelte | 20 ++--- .../components/repo/TagList.stories.svelte | 2 +- web/src/lib/components/repo/TagList.svelte | 4 +- web/src/lib/components/repo/TopicList.svelte | 6 +- web/src/lib/components/repo/TreeHeader.svelte | 6 +- .../repo/TreeView.bones.stories.svelte | 6 +- 49 files changed, 385 insertions(+), 297 deletions(-) diff --git a/web/src/lib/components/repo/BlobHeader.svelte b/web/src/lib/components/repo/BlobHeader.svelte index c7fc1f633..864d1d80b 100644 --- a/web/src/lib/components/repo/BlobHeader.svelte +++ b/web/src/lib/components/repo/BlobHeader.svelte @@ -70,10 +70,10 @@
-
-
+
+
{#if repo} {timeLabel} @@ -100,7 +100,7 @@
{#if sizeLabel} {sizeLabel} @@ -114,12 +114,14 @@
-
+
{#if repo || (language && languageColor)} -
+
{#if language && languageColor}
{language} @@ -137,21 +139,21 @@ {/if} {#if kind !== "submodule"} -
+
{#if showWrapToggle || showBlameToggle || hasRenderedView(kind)} -
+
{#if showBlameToggle} {blameLoading ? "Blame…" : "Blame"} {/if} {#if showWrapToggle} - + Wrap {/if} diff --git a/web/src/lib/components/repo/BlobView.svelte b/web/src/lib/components/repo/BlobView.svelte index 11fac4bbe..d2b68553b 100644 --- a/web/src/lib/components/repo/BlobView.svelte +++ b/web/src/lib/components/repo/BlobView.svelte @@ -10,7 +10,7 @@ import { baseName, fileHistoryHref } from "$lib/components/repo/urls"; import { createBlame, type BlameSource } from "$lib/components/repo/blame/request.svelte"; import Separator from "$lib/components/ui/Separator.svelte"; - import TabPanel from "$lib/components/ui/TabPanel.svelte"; + import Card from "$lib/components/ui/Card.svelte"; interface Props { ownerHandle: string; @@ -121,7 +121,7 @@ const showWrap = $derived(textViewActive && (overflows || wrap)); - + {#if blameRequest.error} - + {/if} {#if blob.lastCommit && repoName} {:else} - + {/if} {#if blob.kind === "submodule" && blob.submodule} @@ -162,7 +162,7 @@ >.

{:else if blob.fileTooLarge} -

+

This file is too large to render. View raw.

{:else} -

+

Previews are not supported for this file type.

{/if} - + diff --git a/web/src/lib/components/repo/BranchList.svelte b/web/src/lib/components/repo/BranchList.svelte index 006edf28f..75126be2a 100644 --- a/web/src/lib/components/repo/BranchList.svelte +++ b/web/src/lib/components/repo/BranchList.svelte @@ -19,10 +19,10 @@ const base = $derived(`/${ownerHandle}/${repoName}`); -
+
{#each branches as branch (branch.name)}
-
+ {#if branch.name !== currentRef} @@ -48,7 +50,7 @@ href={resolve( `${base}/compare/${encodeURIComponent(currentRef)}...${encodeURIComponent(branch.name)}` as "/" )} - class="ml-2 shrink-0" + class="ml-xs shrink-0" title="Compare branches or tags" > Compare diff --git a/web/src/lib/components/repo/BranchTable.svelte b/web/src/lib/components/repo/BranchTable.svelte index 395f757b5..a9fa39289 100644 --- a/web/src/lib/components/repo/BranchTable.svelte +++ b/web/src/lib/components/repo/BranchTable.svelte @@ -19,38 +19,38 @@ const subject = (message?: string) => message?.split("\n\n")[0] ?? ""; -
-

Branches

+
+

Branches

{#if branches.length === 0} -

This repository has no branches.

+

This repository has no branches.

{:else}