fix(frontend): clear node statuses before dry-run simulation in builder

The builder's simulate button runs executeGraph with dry_run=true but
did not call cleanNodesStatuses() beforehand. Without clearing previous
node statuses, the polling-based status updates from the new execution
were not visually reflected — stale state from a prior run prevented
new RUNNING/COMPLETED badges from appearing.

The normal run path (via RunInputDialog) already calls
cleanNodesStatuses() at line 157 of useRunInputDialog.ts. This fix
aligns the dry-run path with the same behavior.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Zamil Majdy
2026-03-28 07:41:54 +00:00
parent 8cc2349717
commit f93556ac69

View File

@@ -33,6 +33,9 @@ export const useRunGraph = () => {
const clearAllNodeErrors = useNodeStore(
useShallow((state) => state.clearAllNodeErrors),
);
const cleanNodesStatuses = useNodeStore(
useShallow((state) => state.cleanNodesStatuses),
);
// Tutorial integration - force open dialog when tutorial requests it
const forceOpenRunInputDialog = useTutorialStore(
@@ -137,6 +140,10 @@ export const useRunGraph = () => {
if (!dryRun && (hasInputs() || hasCredentials())) {
setOpenRunInputDialog(true);
} else {
// Clear previous node statuses so fresh execution results are visible.
// Without this, stale COMPLETED badges from a previous run remain and
// new RUNNING/COMPLETED updates from the dry-run are not rendered.
cleanNodesStatuses();
// Optimistically set running state immediately for responsive UI
setIsGraphRunning(true);
await executeGraph({