From 79fb977f103085982be1249c8b204bb5310db19f Mon Sep 17 00:00:00 2001 From: hjlarry Date: Tue, 14 Oct 2025 09:54:37 +0800 Subject: [PATCH] fix loop/iteration incorrect nodes width --- .../components/workflow/nodes/iteration/use-interactions.ts | 4 +++- web/app/components/workflow/nodes/loop/use-interactions.ts | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/web/app/components/workflow/nodes/iteration/use-interactions.ts b/web/app/components/workflow/nodes/iteration/use-interactions.ts index 5d61d0267f6..7cc7857deba 100644 --- a/web/app/components/workflow/nodes/iteration/use-interactions.ts +++ b/web/app/components/workflow/nodes/iteration/use-interactions.ts @@ -26,7 +26,9 @@ export const useNodeIterationInteractions = () => { const { nodes, setNodes } = collaborativeWorkflow.getState() const currentNode = nodes.find(n => n.id === nodeId)! - const childrenNodes = nodes.filter(n => n.parentId === nodeId) + const childrenNodes = nodes.filter(n => n.parentId === nodeId && n.type !== CUSTOM_ITERATION_START_NODE) + if (!childrenNodes.length) + return let rightNode: Node let bottomNode: Node diff --git a/web/app/components/workflow/nodes/loop/use-interactions.ts b/web/app/components/workflow/nodes/loop/use-interactions.ts index 8e8622a5545..63468edaac9 100644 --- a/web/app/components/workflow/nodes/loop/use-interactions.ts +++ b/web/app/components/workflow/nodes/loop/use-interactions.ts @@ -22,7 +22,9 @@ export const useNodeLoopInteractions = () => { const handleNodeLoopRerender = useCallback((nodeId: string) => { const { nodes, setNodes } = collaborativeWorkflow.getState() const currentNode = nodes.find(n => n.id === nodeId)! - const childrenNodes = nodes.filter(n => n.parentId === nodeId) + const childrenNodes = nodes.filter(n => n.parentId === nodeId && n.type !== CUSTOM_LOOP_START_NODE) + if (!childrenNodes.length) + return let rightNode: Node let bottomNode: Node