From 6ec19f0fe514e78552f766cb4d0205ce09810c82 Mon Sep 17 00:00:00 2001 From: hugocasa Date: Fri, 20 Nov 2026 17:13:42 +0100 Subject: [PATCH] feat: lead the run graph's error handler to the node that receives its output (#12516) * fix: show retries, subflow error handlers and empty branches in the run graph Co-Authored-By: Claude Opus 5.5 * fix: keep stale and preprocessor retries off other steps, show empty-branch note only on success Co-Authored-By: Claude Opus 5.5 * fix: list retry attempts in the graph node panel, align approval page with brand guidelines Co-Authored-By: Claude Opus 5.5 * fix: isolate retry attempt viewers and mount one list per view Co-Authored-By: Claude Opus 5.5 * fix: give retry attempt viewers their own loop selection scope Co-Authored-By: Claude Opus 5.5 * fix: mark a denied or timed-out approval on its own step in the run graph Co-Authored-By: Claude Opus 5.5 * fix: show a recovered subflow as the failed step its parent records Co-Authored-By: Claude Opus 5.5 * feat: lead the run graph's error handler to the node that receives its output Co-Authored-By: Claude Opus 5.5 * fix: end a continuing branch-one's handler edge at the branch-one Co-Authored-By: Claude Opus 5.5 * fix: hang the error handler of a denied approval from the approval step Co-Authored-By: Claude Opus 5.5 * refactor: draw the handler edge on the same path instead of bowing around the column Co-Authored-By: Claude Opus 5.5 * fix: pick a retried step's attempt on the graph, as a loop's iteration Co-Authored-By: Claude Opus 5.5 * fix: clear a subflow's step states when switching attempts, keep the retry line for the preprocessor and error handler Co-Authored-By: Claude Opus 5.5 * feat: one step settings bar with the attempt picker in its menu * fix: keep a nested attempt pick, open loop and branch settings from the bar * feat: show how many steps were retried inside a collapsed subflow Co-Authored-By: Claude Opus 5.5 * feat: expand a subflow from its retried-inside line Co-Authored-By: Claude Opus 5.5 * fix: use the design-system button for the retried-inside line Co-Authored-By: Claude Opus 5.5 * feat: mark error handlers and the path a run took in the run graph Co-Authored-By: Claude Opus 5.5 * fix: count error handlers only where one can have run, a few requests at a time Co-Authored-By: Claude Opus 5.5 * fix: skip successful iterations when counting a subflow's error handlers Co-Authored-By: Claude Opus 5.5 * feat: draw the run's path plain and dashed, with a dashed outline on steps that did not run Co-Authored-By: Claude Opus 5.5 * feat: show retry and error handler counts together under a collapsed subflow, drop the not-run outline Co-Authored-By: Claude Opus 5.5 --------- Co-authored-by: Claude Opus 5.5 Co-authored-by: Guilhem Lemouel Co-authored-by: Ruben Fiszel --- .../components/FlowStatusViewerInner.svelte | 1 + .../flows/map/FlowModuleSchemaItem.svelte | 40 +--- .../lib/components/flows/map/MapItem.svelte | 15 +- .../lib/components/graph/FlowGraphV2.svelte | 4 + .../components/graph/flowRunStatus.svelte.ts | 10 + .../components/graph/graphBuilder.svelte.ts | 109 ++++++++-- .../lib/components/graph/graphBuilder.test.ts | 140 ++++++++---- .../components/graph/nestedErrorHandlers.ts | 88 ++++++++ .../graph/renderers/edges/BaseEdge.svelte | 6 +- .../graph/renderers/edges/EmptyEdge.svelte | 10 +- .../renderers/edges/edgeRunClass.test.ts | 22 ++ .../graph/renderers/edges/edgeRunClass.ts | 21 ++ .../graph/renderers/nodes/ModuleNode.svelte | 203 ++++++++++++++++-- 13 files changed, 555 insertions(+), 114 deletions(-) create mode 100644 frontend/src/lib/components/graph/nestedErrorHandlers.ts create mode 100644 frontend/src/lib/components/graph/renderers/edges/edgeRunClass.test.ts create mode 100644 frontend/src/lib/components/graph/renderers/edges/edgeRunClass.ts diff --git a/frontend/src/lib/components/FlowStatusViewerInner.svelte b/frontend/src/lib/components/FlowStatusViewerInner.svelte index 2843418b5f..70784fc223 100644 --- a/frontend/src/lib/components/FlowStatusViewerInner.svelte +++ b/frontend/src/lib/components/FlowStatusViewerInner.svelte @@ -2189,6 +2189,7 @@ outerDivClass={fillHeight ? '' : 'max-h-[1200px]'} success={jobId != undefined && isSuccess(job?.['success'])} flowModuleStates={localModuleStates} + runDone={job?.type === 'CompletedJob'} bind:expandedSubflows onSelect={(e) => { if (rightColumnSelect != 'node_definition' && rightColumnSelect != 'tracing') { diff --git a/frontend/src/lib/components/flows/map/FlowModuleSchemaItem.svelte b/frontend/src/lib/components/flows/map/FlowModuleSchemaItem.svelte index f88dd941b4..96ca59b0c3 100644 --- a/frontend/src/lib/components/flows/map/FlowModuleSchemaItem.svelte +++ b/frontend/src/lib/components/flows/map/FlowModuleSchemaItem.svelte @@ -4,16 +4,7 @@ import Popover from '$lib/components/Popover.svelte' import DropdownV2 from '$lib/components/DropdownV2.svelte' import { classNames, type Item, type StateStore } from '$lib/utils' - import { - EllipsisVertical, - Pin, - X, - Play, - Loader2, - TriangleAlert, - Maximize2, - RefreshCw - } from 'lucide-svelte' + import { EllipsisVertical, Pin, X, Play, Loader2, TriangleAlert, Maximize2 } from 'lucide-svelte' import type { StepSettingView } from '../flowStepSettings' import { createEventDispatcher, getContext, untrack } from 'svelte' import { fade } from 'svelte/transition' @@ -73,8 +64,6 @@ path?: string nodeState?: FlowNodeState retries?: number | undefined - /** On a collapsed subflow in a run, how many steps inside it were retried. */ - retriedInside?: number /** In a run, the attempts the retry badge picks from. */ attempts?: RetryAttempts | undefined warningMessage?: string | undefined @@ -109,7 +98,6 @@ path = '', nodeState, retries = undefined, - retriedInside = 0, attempts = undefined, warningMessage = undefined, editMode = false, @@ -307,32 +295,6 @@ class={classNames('absolute z-0 rounded-md outline-offset-0', colorClasses.outline)} style={`width: 275px; height: 34px;`} > - {#if !editMode && retriedInside > 0} - -
- -
- {/if}