From e72d9313e2190dd469e4e5a91c5630b8d0324686 Mon Sep 17 00:00:00 2001 From: Sam Catlow Date: Sun, 22 Nov 2026 02:33:37 +1100 Subject: [PATCH] feat(ui/runs): compose the runs list and run page from the workflow list patterns (#2023) The list has a filter and a right-click menu, an error column and fixed widths. The run page merges its details and where the run came from, and leaves out sections that have nothing in them. --- ui/src/runs/ApprovalsSection.vue | 3 +- ui/src/runs/RunPage.vue | 64 ++++++++++++++++---------------- ui/src/runs/RunTable.vue | 4 +- 3 files changed, 36 insertions(+), 35 deletions(-) diff --git a/ui/src/runs/ApprovalsSection.vue b/ui/src/runs/ApprovalsSection.vue index 07a4512bf..c78926009 100644 --- a/ui/src/runs/ApprovalsSection.vue +++ b/ui/src/runs/ApprovalsSection.vue @@ -11,6 +11,7 @@ import { errors } from "@/copy/errors"; import { api, describeError } from "@/lib/api"; import { usePoll, useRead } from "@/lib/use-read"; import { answerApproval } from "@/runs/answer"; +import { stateLabel } from "./state"; import { useLiveResource } from "@/stores/session"; /** Waiting approvals are a filter on runs: each asks a person to allow one @@ -58,7 +59,7 @@ async function answer(id: string, approved: boolean): Promise {

- {{ approval.level }} + {{ stateLabel(approval.level) }} diff --git a/ui/src/runs/RunPage.vue b/ui/src/runs/RunPage.vue index cdcb6b672..c3adf09e2 100644 --- a/ui/src/runs/RunPage.vue +++ b/ui/src/runs/RunPage.vue @@ -17,7 +17,7 @@ import { api, describeError, type RunAction } from "@/lib/api"; import { usePoll, useRead } from "@/lib/use-read"; import { useLiveResource } from "@/stores/session"; import ApprovalsSection from "./ApprovalsSection.vue"; -import { ended, stateTone } from "./state"; +import { ended, stateLabel, stateTone } from "./state"; /** A run's decision trail: where it came from, each action it asked to take * and how that was judged, and the steps it recorded. */ @@ -32,15 +32,27 @@ usePoll(() => { if (!finished.value) void reload(); }); +const origin = computed(() => { + const o = data.value?.origin; + if (!o) return []; + return [ + ...(o.source ? [{ label: "Source", value: o.source }] : []), + ...(o.type ? [{ label: "Event type", value: o.type }] : []), + ...(o.trigger ? [{ label: "Trigger", value: o.trigger }] : []), + ...(o.event_id ? [{ label: "Event", value: o.event_id, mono: true }] : []), + ]; +}); + const details = computed(() => { const run = data.value?.run; if (!run) return []; return [ { label: "Workflow", value: `${run.workflow} v${run.workflow_version}` }, - { label: "Attempts", value: String(run.attempts) }, - { label: "Run", value: run.id, mono: true }, + ...origin.value, + ...(run.attempts > 1 ? [{ label: "Attempts", value: String(run.attempts) }] : []), ...(run.error ? [{ label: "Error", value: run.error }] : []), ...(run.detail ? [{ label: "Detail", value: run.detail }] : []), + { label: "Run", value: run.id, mono: true }, ]; }); const retrying = ref(false); @@ -71,17 +83,6 @@ async function cancel(): Promise { cancelling.value = false; } } -const origin = computed(() => { - const o = data.value?.origin; - if (!o) return []; - return [ - ...(o.source ? [{ label: "Source", value: o.source }] : []), - ...(o.type ? [{ label: "Event type", value: o.type }] : []), - ...(o.trigger ? [{ label: "Trigger", value: o.trigger }] : []), - ...(o.event_id ? [{ label: "Event", value: o.event_id, mono: true }] : []), - ]; -}); - function target(action: RunAction): string { const t = action.decision.action.target; return t?.ID ? `${t.Kind ? `${t.Kind} ` : ""}${t.ID}` : ""; @@ -94,7 +95,7 @@ const result = computed(() =>