From 3873a8d9cefb18bf1db84e53fb394694fbbf9127 Mon Sep 17 00:00:00 2001 From: Sam Catlow Date: Sun, 18 Oct 2026 23:42:08 +1100 Subject: [PATCH] fix(ui): open validation errors from the indicator and link each to its step --- ui/src/workflows/WorkflowEditor.vue | 34 +++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/ui/src/workflows/WorkflowEditor.vue b/ui/src/workflows/WorkflowEditor.vue index a71673fee..cd0de855d 100644 --- a/ui/src/workflows/WorkflowEditor.vue +++ b/ui/src/workflows/WorkflowEditor.vue @@ -18,6 +18,7 @@ import { DropdownMenuItem, DropdownMenuTrigger, } from "@/components/ui/dropdown-menu"; +import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover"; import { Spinner } from "@/components/ui/spinner"; import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; import { Textarea } from "@/components/ui/textarea"; @@ -316,6 +317,21 @@ const nodeProblems = computed(() => { if (result.ok || !failed) return problems.value; return { [JSON.stringify(["steps", Number(failed[1]) - 1])]: result.message, ...problems.value }; }); +// Every error the editor knows, each linked to its step when it has one. +const errors = computed(() => { + const list: { text: string; path?: StepPath }[] = []; + if (!parsed.value.ok) { + const step = /^workflow \S+ step (\d+)\b/.exec(parsed.value.message)?.[1]; + list.push({ text: validationLabel(parsed.value), path: step ? ["steps", Number(step) - 1] : undefined }); + } + for (const [key, text] of Object.entries(problems.value)) list.push({ text, path: JSON.parse(key) as StepPath }); + return list; +}); +function showError(path?: StepPath): void { + if (!path) return; + view.value = "canvas"; + openStepAt(path); +} const WORKS_ON: Record = { optional: "Repository if given", none: "No repository" }; const REQUIRED = "Works on a repository"; const workflowSummary = computed(() => @@ -385,10 +401,20 @@ function syncScroll(event: Event): void {
- - - + + + + + +
    +
  • + +

    {{ error.text }}

    +
  • +
+
+