Browse Source

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 <noreply@anthropic.com>
handoff-20260429-1057
shrimbly 4 months ago
parent
commit
753790b36c
  1. 3
      src/components/nodes/BaseNode.tsx
  2. 2
      src/store/utils/connectedInputs.ts

3
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 },
};
})

2
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))

Loading…
Cancel
Save