fix(ui): count completed runs as delivered on the workflows surfaces

The workflows page's per-workflow bar and its 'N of M' text, and the
workflow picker's percent on the new-task form, counted `merged` alone.
A workflow whose runs now end `completed` (a no-change build, a triage
that needed no code) therefore rendered zero delivery beside three
sibling surfaces that already counted both.

The count moves into ui/src/lib/delivered.ts, which GatePulseCard,
ThroughputTiles and TasksSummary now read too instead of keeping their
own copies of the arithmetic. The picker's label says delivered, not
merged: a run that ends completed is not merged.
This commit is contained in:
sam committed 2026-09-26 04:01:08 +10:00
1 parent 4f62ce5dfc
commit f7bfd78d5f
8 files changed
+114 -21

No files matched your search

+2 -1
View File
@@ -17,6 +17,7 @@ import {
import { Spinner } from "@/components/ui/spinner";
import { Textarea } from "@/components/ui/textarea";
import { api } from "@/lib/api";
import { delivered } from "@/lib/delivered";
import { useIdentitiesStore } from "@/stores/identities";
import type { WorkflowDefinition, WorkflowStats } from "@/workflows/workflow-rows";
@@ -119,7 +120,7 @@ async function submit() {
<span class="block truncate font-mono text-[13px] font-medium">{{ d.name || d.id }}</span>
<span class="block text-xs text-fg-subtle">
{{ statFor(d.id)?.runs || 0 }} runs<template v-if="statFor(d.id)?.runs">
· {{ Math.round(((statFor(d.id)?.merged || 0) / (statFor(d.id)?.runs || 1)) * 100) }}% merged</template
· {{ Math.round((delivered(statFor(d.id)) / (statFor(d.id)?.runs || 1)) * 100) }}% delivered</template
>
</span>
</RadioGroupItem>