diff --git a/web/src/lib/components/repo/pipelines/PipelineWorkflows.svelte b/web/src/lib/components/repo/pipelines/PipelineWorkflows.svelte index 9326eac2..2b9da6ae 100644 --- a/web/src/lib/components/repo/pipelines/PipelineWorkflows.svelte +++ b/web/src/lib/components/repo/pipelines/PipelineWorkflows.svelte @@ -4,7 +4,7 @@ export const pipelineWorkflows = tv({ slots: { waiting: "inline-flex items-center gap-1", - trigger: "flex items-center gap-1 text-foreground-muted hover:underline", + trigger: "flex items-center gap-2", icon: "size-3 shrink-0", symbol: "", // Button hugs its children, so stretch that span to get a two-column row @@ -13,12 +13,12 @@ name: "flex min-w-0 items-center gap-1.5", label: "truncate", outcome: "shrink-0 text-foreground-muted", - status: "mt-0.5" + status: "" }, variants: { variant: { // "2/3 workflows" with a chevron, for a card that has room to spell it out - count: { waiting: "italic", symbol: "size-3" }, + count: { symbol: "size-3" }, // the appview's pipelineSymbol: a status ring plus a bare tally symbol: { trigger: "gap-1.5" } } @@ -41,6 +41,9 @@ import PipelineStatusIcon from "./PipelineStatusIcon.svelte"; import PipelineSymbol from "./PipelineSymbol.svelte"; import ShimmerText from "$lib/components/ui/ShimmerText.svelte"; + import Button from "$lib/components/ui/Button.svelte"; + import type { Component } from "svelte"; + import type { SvelteHTMLElements } from "svelte/elements"; interface Props { ownerHandle: string; @@ -50,15 +53,28 @@ variant?: PipelineWorkflowsVariants["variant"]; /** symbol variant only: "2/3" against the full "2/3 passed, 1/3 failed" breakdown */ summary?: "short" | "long"; + chevron?: boolean; + icon?: Component; + iconClass?: string; } - let { ownerHandle, repoName, pipeline, variant = "count", summary = "short" }: Props = $props(); + let { + ownerHandle, + repoName, + pipeline, + variant = "count", + summary = "short", + chevron = false, + icon, + iconClass + }: Props = $props(); const count = $derived(pipeline.workflows.length); const finished = $derived(finishedCount(pipeline)); const noun = $derived(count === 1 ? "workflow" : "workflows"); // show the ratio only while something is still running const label = $derived(finished === count ? `${count} ${noun}` : `${finished}/${count} ${noun}`); + const Icon = $derived(icon); const classes = $derived(pipelineWorkflows({ variant })); @@ -66,7 +82,9 @@ {#if count === 0} - @@ -74,11 +92,16 @@ {#if variant === "count"} Waiting for a spindle… {/if} - + {:else} + {#snippet trigger()} - {#if variant === "symbol"} - + {#if chevron} + {#if Icon} + {/snippet}