fix(ui): mark the step failing validation on its canvas node

This commit is contained in:
sam committed 2026-10-18 23:45:27 +11:00
1 parent eb8e542ab8
commit a4db4b5247
1 file changed
+8 -1
+8 -1
View File
@@ -309,6 +309,13 @@ const problems = computed(() =>
}),
),
);
// The parse stops at the first failing step; its node carries that failure too.
const nodeProblems = computed(() => {
const result = parsed.value;
const failed = result.ok ? null : /^workflow \S+ step (\d+)\b/.exec(result.message);
if (result.ok || !failed) return problems.value;
return { [JSON.stringify(["steps", Number(failed[1]) - 1])]: result.message, ...problems.value };
});
const WORKS_ON: Record<string, string> = { optional: "Repository if given", none: "No repository" };
const REQUIRED = "Works on a repository";
const workflowSummary = computed(() =>
@@ -425,7 +432,7 @@ function syncScroll(event: Event): void {
:triggers="triggers"
:types="stepTypeNames"
:restartable="restartable"
:problems="problems"
:problems="nodeProblems"
:title="parsed.ok ? parsed.id : id"
:summary="workflowSummary"
@toggle="toggle"