count block children in determining whether to enable debugging via b… (#3067)

This commit is contained in:
Jonathan Dobson
2025-07-31 09:34:30 -04:00
committed by GitHub
parent 9193ef1210
commit b31e6147ac
2 changed files with 15 additions and 2 deletions

View File

@@ -89,6 +89,7 @@ import {
descendants,
generateNodeLabel,
getAdditionalParametersForEmailBlock,
getOrderedChildrenBlocks,
getOutputParameterKey,
getWorkflowBlocks,
getWorkflowErrors,
@@ -397,10 +398,21 @@ function FlowRenderer({
}, [nodesInitialized]);
useEffect(() => {
const blocks = getWorkflowBlocks(nodes, edges);
const debuggable = blocks.filter((block) =>
const topLevelBlocks = getWorkflowBlocks(nodes, edges);
const debuggable = topLevelBlocks.filter((block) =>
debuggableWorkflowBlockTypes.has(block.block_type),
);
for (const node of nodes) {
const childBlocks = getOrderedChildrenBlocks(nodes, edges, node.id);
for (const child of childBlocks) {
if (debuggableWorkflowBlockTypes.has(child.block_type)) {
debuggable.push(child);
}
}
}
setDebuggableBlockCount(debuggable.length);
}, [nodes, edges]);

View File

@@ -2242,6 +2242,7 @@ export {
getLabelForWorkflowParameterType,
maxNestingLevel,
getWorkflowSettings,
getOrderedChildrenBlocks,
getOutputParameterKey,
getPreviousNodeIds,
getUniqueLabelForExistingNode,