From 753790b36cdcce94a72175b6a3f7143e5dcc04fd Mon Sep 17 00:00:00 2001 From: shrimbly Date: Sun, 22 Mar 2026 22:27:56 +1300 Subject: [PATCH] fix: clamp expand height to minHeight and resolve text through switch nodes BaseNode: the settings expand branch now clamps the computed height to minHeight, matching the collapse and ResizeObserver branches. connectedInputs: resolveTextSourcesThroughRouters now recurses through switch nodes (same as routers) so upstream text sources are not missed. Co-Authored-By: Claude Opus 4.6 --- src/components/nodes/BaseNode.tsx | 3 ++- src/store/utils/connectedInputs.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/nodes/BaseNode.tsx b/src/components/nodes/BaseNode.tsx index 59a8aed4..dbff515e 100644 --- a/src/components/nodes/BaseNode.tsx +++ b/src/components/nodes/BaseNode.tsx @@ -150,8 +150,9 @@ export function BaseNode({ : 0; const heightToAdd = finalHeight - savedPanelHeight; const currentHeight = getNodeDimension(node, "height"); + const newHeight = Math.max(minHeight, currentHeight + heightToAdd); return { - ...applyNodeDimensions(node, getNodeDimension(node, "width"), currentHeight + heightToAdd), + ...applyNodeDimensions(node, getNodeDimension(node, "width"), newHeight), data: { ...node.data, _settingsPanelHeight: finalHeight }, }; }) diff --git a/src/store/utils/connectedInputs.ts b/src/store/utils/connectedInputs.ts index 2c8b817f..cf9c7821 100644 --- a/src/store/utils/connectedInputs.ts +++ b/src/store/utils/connectedInputs.ts @@ -138,7 +138,7 @@ export function resolveTextSourcesThroughRouters( if (seen.has(node.id)) continue; seen.add(node.id); - if (node.type === "router") { + if (node.type === "router" || node.type === "switch") { const upstreamNodes = edges .filter((e) => e.target === node.id && e.targetHandle === "text") .map((e) => allNodes.find((n) => n.id === e.source))