From 3c8c546543a2a7e7a09b43c8308f1e92edccf540 Mon Sep 17 00:00:00 2001 From: eti Date: Wed, 5 Aug 2026 14:56:05 +0300 Subject: [PATCH] web/components/pipelines: let the workflows trigger be clickable The trigger snippet wrapped its content in a Button, but Dropdown already renders one, so the markup was a button inside a button. The HTML parser splits those apart, which leaves the visible label next to the element that carries popovertarget instead of inside it: with no JS the menu never opens, and either way the control is two tab stops. Dropdown can render the ghost button itself, so use that and keep only the layout span in the snippet. Same look, same box, one button. This also carries the in-progress chevron/icon props that were sitting uncommitted in the working tree. Signed-off-by: eti --- .../repo/pipelines/PipelineWorkflows.svelte | 48 ++++++++++++++----- 1 file changed, 37 insertions(+), 11 deletions(-) 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} -- 2.51.2