From b31e6147acd3ad76575a2ccc3b4e6e0a5b706baa Mon Sep 17 00:00:00 2001 From: Jonathan Dobson Date: Thu, 31 Jul 2025 09:34:30 -0400 Subject: [PATCH] =?UTF-8?q?count=20block=20children=20in=20determining=20w?= =?UTF-8?q?hether=20to=20enable=20debugging=20via=20b=E2=80=A6=20(#3067)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/routes/workflows/editor/FlowRenderer.tsx | 16 ++++++++++++++-- .../workflows/editor/workflowEditorUtils.ts | 1 + 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/skyvern-frontend/src/routes/workflows/editor/FlowRenderer.tsx b/skyvern-frontend/src/routes/workflows/editor/FlowRenderer.tsx index 36072315..75ea27be 100644 --- a/skyvern-frontend/src/routes/workflows/editor/FlowRenderer.tsx +++ b/skyvern-frontend/src/routes/workflows/editor/FlowRenderer.tsx @@ -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]); diff --git a/skyvern-frontend/src/routes/workflows/editor/workflowEditorUtils.ts b/skyvern-frontend/src/routes/workflows/editor/workflowEditorUtils.ts index ea989cef..ca1d1644 100644 --- a/skyvern-frontend/src/routes/workflows/editor/workflowEditorUtils.ts +++ b/skyvern-frontend/src/routes/workflows/editor/workflowEditorUtils.ts @@ -2242,6 +2242,7 @@ export { getLabelForWorkflowParameterType, maxNestingLevel, getWorkflowSettings, + getOrderedChildrenBlocks, getOutputParameterKey, getPreviousNodeIds, getUniqueLabelForExistingNode,