From 9a9629400e09a2a5bfc6e8034b71c153ffed7ed6 Mon Sep 17 00:00:00 2001 From: archie Date: Tue, 10 Nov 2026 05:53:59 +0000 Subject: [PATCH] Expose all task actions in the task detail header (archie) --- ui/src/tasks/StartNewRun.vue | 98 ------------------------ ui/src/tasks/TaskHeader.vue | 18 +---- ui/src/tasks/task-actions.ts | 42 +++++++++- ui/src/tasks/task-run.ts | 5 +- ui/src/tasks/use-task-run.ts | 50 +----------- ui/test/task-actions.test.ts | 144 ++++++++++++++++++++++++++++++++++- 6 files changed, 193 insertions(+), 164 deletions(-) delete mode 100644 ui/src/tasks/StartNewRun.vue diff --git a/ui/src/tasks/StartNewRun.vue b/ui/src/tasks/StartNewRun.vue deleted file mode 100644 index 74ed0f7c7..000000000 --- a/ui/src/tasks/StartNewRun.vue +++ /dev/null @@ -1,98 +0,0 @@ - - - diff --git a/ui/src/tasks/TaskHeader.vue b/ui/src/tasks/TaskHeader.vue index 3323153ca..2a71a94e7 100644 --- a/ui/src/tasks/TaskHeader.vue +++ b/ui/src/tasks/TaskHeader.vue @@ -22,14 +22,13 @@ import { approvalLabels, statusKind, statusLabel } from "@/lib/task-meta"; import DispatchLinks from "@/bindings/DispatchLinks.vue"; import { MetadataList } from "@/components/ui/metadata-list"; import { Section } from "@/components/ui/section"; -import StartNewRun from "./StartNewRun.vue"; import TaskRowActions from "./TaskRowActions.vue"; -import { shownActionIds } from "./task-actions"; +import { headerActionIds } from "./task-actions"; import { useTaskRun } from "./use-task-run"; /** * The task's head: where it sits, what it is, its state and forge links, and - * the page's one decision, starting a new run. A parked task opens with the + * its server-authorized lifecycle controls. A parked task opens with the * reason it stopped. */ const props = defineProps<{ id: string }>(); @@ -89,12 +88,6 @@ async function jumpToLog(): Promise { } } -// The head has room for the reap an operator reaches for once a task is -// finished with. Whether this task offers it is the server's action list, -// never this page's opinion about the status. Approval answers live with the -// thing being approved. -const HEAD_ACTIONS = computed(() => ["archive", "merge"]); - // The run's inputs and written outputs, one row per name. const rows = (values?: Record) => Object.entries(values ?? {}).map(([label, value]) => ({ @@ -108,9 +101,7 @@ const sections = computed(() => { title: "Outputs", rows: rows(run.attempts?.outputs) }, ].filter((section) => section.rows.length), ); -const headerActions = computed(() => - shownActionIds(run.task?.actions, HEAD_ACTIONS.value), -); +const headerActions = computed(() => headerActionIds(run.task));