diff --git a/ui/src/chat/state.ts b/ui/src/chat/state.ts index 10e947f77..29f948810 100644 --- a/ui/src/chat/state.ts +++ b/ui/src/chat/state.ts @@ -663,7 +663,9 @@ export const pageTag = computed(() => { const label = route.name === "task-detail" ? `Task #${route.params.id}` - : typeof route.meta.label === "string" + : route.name === "workflows" && typeof route.query.workflow === "string" + ? `Workflow ${route.query.workflow}` + : typeof route.meta.label === "string" ? route.meta.label : page; return { page, label }; diff --git a/ui/src/workflows/WorkflowsPage.vue b/ui/src/workflows/WorkflowsPage.vue index 5b4ee43a2..0c15bc449 100644 --- a/ui/src/workflows/WorkflowsPage.vue +++ b/ui/src/workflows/WorkflowsPage.vue @@ -110,6 +110,13 @@ watch( }, { immediate: true }, ); +// The selection goes back into ?workflow= so the URL names it: a reload keeps +// it, and the chat's page context tells Archie which workflow is open. +watch(selected, (id) => { + if (!id || route.query.workflow === id) return; + applied = id; + void router.replace({ query: { ...route.query, workflow: id } }); +}); // Whether this workflow is still the one archie ships: "Edited" when it has // been changed, "Custom" when archie ships nothing by that name. const provenance = computed(() => {