From a8acb5404c2e6c3e39a60b1aafae1ee8a9f3b06a Mon Sep 17 00:00:00 2001 From: eti Date: Fri, 4 Sep 2026 14:32:10 +0200 Subject: [PATCH] web/pipelines: make PipelineSymbol icon size follow parent size & other visual nits Signed-off-by: eti Signed-off-by: dawn --- web/src/lib/components/repo/CommitList.svelte | 6 +-- .../repo/pipelines/PipelineCard.svelte | 2 +- .../repo/pipelines/PipelineCardContent.svelte | 4 +- .../repo/pipelines/PipelineStatusIcon.svelte | 17 +++++++-- .../repo/pipelines/PipelineSymbol.svelte | 32 +++++++++------- .../repo/pipelines/PipelineWorkflows.svelte | 14 +++---- .../repo/pipelines/WorkflowSidebar.svelte | 2 +- web/src/lib/components/ui/Button.svelte | 37 ++++++++++++++++--- 8 files changed, 78 insertions(+), 36 deletions(-) diff --git a/web/src/lib/components/repo/CommitList.svelte b/web/src/lib/components/repo/CommitList.svelte index 8ef53fb2a..e894c46b6 100644 --- a/web/src/lib/components/repo/CommitList.svelte +++ b/web/src/lib/components/repo/CommitList.svelte @@ -27,7 +27,7 @@
{#each commits as commit (commit.hash)}
- + {#if commit.body && expanded[commit.hash]}

diff --git a/web/src/lib/components/repo/pipelines/PipelineCardContent.svelte b/web/src/lib/components/repo/pipelines/PipelineCardContent.svelte index 0aa4f725c..0f9bf95a1 100644 --- a/web/src/lib/components/repo/pipelines/PipelineCardContent.svelte +++ b/web/src/lib/components/repo/pipelines/PipelineCardContent.svelte @@ -4,13 +4,13 @@ export const pipelineCardContent = tv({ slots: { header: "flex items-start justify-between gap-3 pb-2 md:pb-0", - trigger: "flex min-w-0 flex-wrap items-center gap-x-1.5 gap-y-1", + trigger: "flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1", triggerRow: "flex flex-wrap items-center gap-x-1.5 gap-y-1 text-foreground-default", triggerIcon: "size-4 shrink-0 text-foreground-muted", triggerVerb: "text-foreground-muted", triggerRef: "font-semibold", triggerArrow: "size-3 shrink-0 text-foreground-muted", - sha: "shrink-0 rounded-sm bg-background-inset px-2 py-0.5 typography-monospace-small text-foreground-default no-underline hover:underline", + sha: "shrink-0 self-center rounded-sm bg-background-inset px-2 py-0.5 typography-monospace-small text-foreground-default no-underline hover:underline", meta: "flex flex-wrap items-center justify-between text-foreground-muted", metaSub: "mr-2 flex flex-wrap items-center gap-2", workflows: "", diff --git a/web/src/lib/components/repo/pipelines/PipelineStatusIcon.svelte b/web/src/lib/components/repo/pipelines/PipelineStatusIcon.svelte index f2dd324e9..a39a7e181 100644 --- a/web/src/lib/components/repo/pipelines/PipelineStatusIcon.svelte +++ b/web/src/lib/components/repo/pipelines/PipelineStatusIcon.svelte @@ -20,7 +20,6 @@ }; export const pipelineStatusIcon = tv({ - base: "size-3 shrink-0", variants: { status: { pending: "text-foreground-muted", @@ -37,17 +36,29 @@ diff --git a/web/src/lib/components/repo/pipelines/PipelineSymbol.svelte b/web/src/lib/components/repo/pipelines/PipelineSymbol.svelte index 6d70a1326..548024171 100644 --- a/web/src/lib/components/repo/pipelines/PipelineSymbol.svelte +++ b/web/src/lib/components/repo/pipelines/PipelineSymbol.svelte @@ -2,7 +2,6 @@ import { tv } from "tailwind-variants"; import type { PipelineStatus } from "$lib/components/repo/types"; - // must match STATUS_STROKES to PipelineStatusIcon's colours or the ring/icon disagree export const STATUS_STROKES: Record = { pending: "stroke-foreground-placeholder", running: "stroke-foreground-warning", @@ -14,10 +13,8 @@ export const pipelineSymbol = tv({ slots: { - icon: "size-4 shrink-0", - waiting: "size-4 shrink-0 text-foreground-muted", - // -rotate-90 puts the first arc at twelve o'clock instead of three - ring: "size-4 shrink-0 -rotate-90" + waiting: "text-foreground-muted", + ring: "-rotate-90" } }); @@ -30,13 +27,22 @@ import type { PipelineSummary } from "$lib/components/repo/types"; import { statusCounts, STATUS_ORDER } from "$lib/components/repo/pipelines/pipeline"; import PipelineStatusIcon from "$lib/components/repo/pipelines/PipelineStatusIcon.svelte"; + import { + buttonIcon, + getButtonIconSize, + type ButtonIconVariants + } from "$lib/components/ui/Button.svelte"; interface Props { pipeline: PipelineSummary; class?: string; + size?: ButtonIconVariants["size"]; } - let { pipeline, class: className }: Props = $props(); + let { pipeline, class: className, size }: Props = $props(); + + const inheritedSize = getButtonIconSize(); + const iconClasses = $derived(buttonIcon({ size: size ?? inheritedSize?.() })); const arcs = $derived.by(() => { const counts = statusCounts(pipeline); @@ -54,15 +60,15 @@ {#if arcs.length === 0} -

- + {STATUS_LABELS[workflow.status]}
{#if workflow.duration > 0} diff --git a/web/src/lib/components/ui/Button.svelte b/web/src/lib/components/ui/Button.svelte index 55276d994..8ea2e347f 100644 --- a/web/src/lib/components/ui/Button.svelte +++ b/web/src/lib/components/ui/Button.svelte @@ -1,4 +1,5 @@ {#snippet content()} @@ -150,16 +177,16 @@ class="inline-flex min-w-0 items-center justify-center gap-[inherit] transition-transform duration-150 ease-in-out" > {#if loading} - + {:else} {#if Icon && iconSide == "left"} -