Browse Source

fix: restore skippedNodeIds to store for canvas visual feedback

The rebase dropped the commit that re-added skippedNodeIds to the store
interface since develop had already extracted it to a local variable.
However, WorkflowCanvas.tsx needs to observe skippedNodeIds from the
store to apply visual dimming during execution.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
handoff-20260429-1057
shrimbly 4 months ago
parent
commit
139c1f02c2
  1. 18
      src/store/workflowStore.ts

18
src/store/workflowStore.ts

@ -373,6 +373,9 @@ interface WorkflowStore {
// Switch dimming state // Switch dimming state
dimmedNodeIds: Set<string>; dimmedNodeIds: Set<string>;
// Skip propagation state (optional empty inputs)
skippedNodeIds: Set<string>;
// Switch dimming actions // Switch dimming actions
recomputeDimmedNodes: () => void; recomputeDimmedNodes: () => void;
@ -507,6 +510,9 @@ const workflowStoreImpl: StateCreator<WorkflowStore> = (set, get) => ({
// Switch dimming initial state // Switch dimming initial state
dimmedNodeIds: new Set<string>(), dimmedNodeIds: new Set<string>(),
// Skip propagation initial state
skippedNodeIds: new Set<string>(),
setEdgeStyle: (style: EdgeStyle) => { setEdgeStyle: (style: EdgeStyle) => {
set({ edgeStyle: style }); set({ edgeStyle: style });
}, },
@ -1007,7 +1013,7 @@ const workflowStoreImpl: StateCreator<WorkflowStore> = (set, get) => ({
} }
} }
}; };
set({ isRunning: true, pausedAtNodeId: null, currentNodeIds: [], _abortController: abortController }); set({ isRunning: true, pausedAtNodeId: null, currentNodeIds: [], skippedNodeIds: new Set(), _abortController: abortController });
// Start logging session // Start logging session
await logger.startSession(); await logger.startSession();
@ -1089,6 +1095,7 @@ const workflowStoreImpl: StateCreator<WorkflowStore> = (set, get) => ({
(node.type === "prompt" && !(nodeData.prompt as string)?.trim()); (node.type === "prompt" && !(nodeData.prompt as string)?.trim());
if (isEmpty) { if (isEmpty) {
skippedNodeIds.add(node.id); skippedNodeIds.add(node.id);
set({ skippedNodeIds: new Set(skippedNodeIds) });
logger.info('node.execution', 'Node skipped (optional input empty)', { logger.info('node.execution', 'Node skipped (optional input empty)', {
nodeId: node.id, nodeId: node.id,
nodeType: node.type, nodeType: node.type,
@ -1102,6 +1109,7 @@ const workflowStoreImpl: StateCreator<WorkflowStore> = (set, get) => ({
const hasSkippedSource = incomingEdgesForSkip.some((e) => skippedNodeIds.has(e.source)); const hasSkippedSource = incomingEdgesForSkip.some((e) => skippedNodeIds.has(e.source));
if (hasSkippedSource) { if (hasSkippedSource) {
skippedNodeIds.add(node.id); skippedNodeIds.add(node.id);
set({ skippedNodeIds: new Set(skippedNodeIds) });
if (nodeData.status !== undefined) { if (nodeData.status !== undefined) {
get().updateNodeData(node.id, { status: "skipped" } as Partial<WorkflowNodeData>); get().updateNodeData(node.id, { status: "skipped" } as Partial<WorkflowNodeData>);
} }
@ -1257,7 +1265,7 @@ const workflowStoreImpl: StateCreator<WorkflowStore> = (set, get) => ({
resetSkippedNodes(); resetSkippedNodes();
set({ isRunning: false, currentNodeIds: [], _abortController: null }); set({ isRunning: false, currentNodeIds: [], skippedNodeIds: new Set(), _abortController: null });
saveLogSession(); saveLogSession();
await logger.endSession(); await logger.endSession();
@ -1274,7 +1282,7 @@ const workflowStoreImpl: StateCreator<WorkflowStore> = (set, get) => ({
); );
} }
resetSkippedNodes(); resetSkippedNodes();
set({ isRunning: false, currentNodeIds: [], _abortController: null }); set({ isRunning: false, currentNodeIds: [], skippedNodeIds: new Set(), _abortController: null });
saveLogSession(); saveLogSession();
await logger.endSession(); await logger.endSession();
@ -1287,7 +1295,7 @@ const workflowStoreImpl: StateCreator<WorkflowStore> = (set, get) => ({
if (controller) { if (controller) {
controller.abort("user-cancelled"); controller.abort("user-cancelled");
} }
set({ isRunning: false, currentNodeIds: [], _abortController: null }); set({ isRunning: false, currentNodeIds: [], skippedNodeIds: new Set(), _abortController: null });
}, },
setMaxConcurrentCalls: (value: number) => { setMaxConcurrentCalls: (value: number) => {
@ -1822,6 +1830,8 @@ const workflowStoreImpl: StateCreator<WorkflowStore> = (set, get) => ({
viewedCommentNodeIds: new Set<string>(), viewedCommentNodeIds: new Set<string>(),
// Reset dimmed nodes // Reset dimmed nodes
dimmedNodeIds: new Set<string>(), dimmedNodeIds: new Set<string>(),
// Reset skipped nodes
skippedNodeIds: new Set<string>(),
}); });
get().clearSnapshot(); get().clearSnapshot();
}, },

Loading…
Cancel
Save