From f4bfa59deca374ca5f191e297340f1a066874000 Mon Sep 17 00:00:00 2001 From: Sam Catlow Date: Sun, 22 Nov 2026 02:32:12 +1100 Subject: [PATCH] feat(ui/workflows): restore the workflow list and page on the archie binary (#2023) The list and page keep the original layout and read the binary's API. Duplicate triggers are grouped. Runs and run pages use the shared table. The older editor stays on its hidden route as WorkflowEditorPage. --- ui/src/router/routes.ts | 15 +- ui/src/runs/RunTable.vue | 53 ++++++ ui/src/runs/RunsPage.vue | 77 +++----- ui/src/runs/state.ts | 5 + ui/src/workflows/WorkflowEditorPage.vue | 2 +- ui/src/workflows/WorkflowHistory.vue | 2 +- ui/src/workflows/WorkflowLastRun.vue | 8 +- ui/src/workflows/WorkflowPage.vue | 230 ++++++++++++++++++++++++ ui/src/workflows/WorkflowRowActions.vue | 19 +- ui/src/workflows/WorkflowsPage.vue | 225 ++++++++++------------- ui/src/workflows/use-workflow-list.ts | 80 +++++++++ 11 files changed, 509 insertions(+), 207 deletions(-) create mode 100644 ui/src/runs/RunTable.vue create mode 100644 ui/src/workflows/WorkflowPage.vue create mode 100644 ui/src/workflows/use-workflow-list.ts diff --git a/ui/src/router/routes.ts b/ui/src/router/routes.ts index 337fd04b4..e802ead3a 100644 --- a/ui/src/router/routes.ts +++ b/ui/src/router/routes.ts @@ -32,8 +32,7 @@ const SystemTasksPage = () => import("@/settings/SystemTasksPage.vue"); const SkillsPage = () => import("@/skills/SkillsPage.vue"); const TaskDetailPage = () => import("@/tasks/TaskDetailPage.vue"); const TasksPage = () => import("@/tasks/TasksPage.vue"); -const WorkflowsPage = () => import("@/workflows/WorkflowsPage.vue"); -const WorkflowPage = () => import("@/workflows/WorkflowPage.vue"); +const WorkflowEditorPage = () => import("@/workflows/WorkflowEditorPage.vue"); // internal/gateway/dashboard_tools.go mirrors this table. // @@ -94,7 +93,7 @@ export const routes: RouteRecordRaw[] = [ { path: "/workflows", name: "workflows", - component: () => import("@/workflows/WorkflowListPage.vue"), + component: () => import("@/workflows/WorkflowsPage.vue"), // Links written as /workflows?workflow= open that workflow's page. beforeEnter: (to: RouteLocationGeneric) => { const { workflow, ...query } = to.query; @@ -110,21 +109,15 @@ export const routes: RouteRecordRaw[] = [ { path: "/workflows/:id", name: "workflow", - component: () => import("@/workflows/WorkflowDocumentPage.vue"), + component: () => import("@/workflows/WorkflowPage.vue"), meta: { label: "Workflow", nav: false, navPath: "/workflows", section: "workflows" }, }, // The visual editor, with drafts, test runs and per-step statistics; it // needs workflow drafts and run stages the binary does not serve yet. - { - path: "/workflow-editor", - name: "workflow-editor-list", - component: WorkflowsPage, - meta: { label: "Workflow editor", nav: false, navPath: "/workflows", section: "workflow_editor" }, - }, { path: "/workflow-editor/:id", name: "workflow-editor", - component: WorkflowPage, + component: WorkflowEditorPage, meta: { label: "Workflow", nav: false, navPath: "/workflows", section: "workflow_editor" }, }, { diff --git a/ui/src/runs/RunTable.vue b/ui/src/runs/RunTable.vue new file mode 100644 index 000000000..f98260051 --- /dev/null +++ b/ui/src/runs/RunTable.vue @@ -0,0 +1,53 @@ + + + diff --git a/ui/src/runs/RunsPage.vue b/ui/src/runs/RunsPage.vue index e3c92e0f4..1951390be 100644 --- a/ui/src/runs/RunsPage.vue +++ b/ui/src/runs/RunsPage.vue @@ -1,75 +1,52 @@ diff --git a/ui/src/runs/state.ts b/ui/src/runs/state.ts index bc36c45f6..82aa0a953 100644 --- a/ui/src/runs/state.ts +++ b/ui/src/runs/state.ts @@ -25,6 +25,11 @@ export function stateTone(state: string): "ok" | "warn" | "danger" | "info" | "i } } +/** A run state in words: "waiting_approval" reads "waiting approval". */ +export function stateLabel(state: string): string { + return state.replace(/_/g, " "); +} + /** Whether a run state is terminal: the run has ended and cannot be cancelled. */ export function ended(state: string): boolean { switch (state) { diff --git a/ui/src/workflows/WorkflowEditorPage.vue b/ui/src/workflows/WorkflowEditorPage.vue index ebc234c6c..285e1df2c 100644 --- a/ui/src/workflows/WorkflowEditorPage.vue +++ b/ui/src/workflows/WorkflowEditorPage.vue @@ -20,7 +20,7 @@ const { store, data, error, loading, statsKnown, load, enabledOf, setEnabled, du // under another id or deleting, and the URL follows. const selected = computed({ get: () => String(route.params.id ?? ""), - set: (id: string) => void (id ? router.replace({ name: "workflow-editor", params: { id }, query: route.query }) : router.replace({ name: "workflow-editor-list" })), + set: (id: string) => void (id ? router.replace({ name: "workflow-editor", params: { id }, query: route.query }) : router.replace({ name: "workflows" })), }); // ?view= opens a tab and ?run= opens the run dialog; a link carries them once. diff --git a/ui/src/workflows/WorkflowHistory.vue b/ui/src/workflows/WorkflowHistory.vue index 8a5c1dd55..0aedab036 100644 --- a/ui/src/workflows/WorkflowHistory.vue +++ b/ui/src/workflows/WorkflowHistory.vue @@ -54,7 +54,7 @@ const CHANGE_VARIANTS = { added: "default", edited: "secondary", removed: "destr v{{ item.version }} {{ item.change }} - {{ item.actor || "unknown" }} · {{ item.source || "unknown" }} · + {{ item.actor || "unknown" }} · diff --git a/ui/src/workflows/WorkflowLastRun.vue b/ui/src/workflows/WorkflowLastRun.vue index 4215767d9..922d919fa 100644 --- a/ui/src/workflows/WorkflowLastRun.vue +++ b/ui/src/workflows/WorkflowLastRun.vue @@ -1,16 +1,16 @@