Browse Source

fix(46-04): floating header width tracks resized node width

Use node.style.width (number or string), node.measured.width, or
default dimensions — in that priority order. Headers now match the
actual node width after user resize.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
handoff-20260429-1057
shrimbly 4 months ago
parent
commit
0ff5472d35
  1. 13
      src/components/WorkflowCanvas.tsx

13
src/components/WorkflowCanvas.tsx

@ -2060,9 +2060,14 @@ export function WorkflowCanvas() {
// Groups don't get floating headers
if (node.type === "group") return null;
const nodeWidth = typeof node.style?.width === "number"
? node.style.width
: (defaultNodeDimensions[node.type as NodeType]?.width ?? 250);
const styleW = node.style?.width;
const nodeWidth =
typeof styleW === "number" ? styleW
: typeof styleW === "string" ? parseFloat(styleW) || 0
: 0;
const measuredWidth = (node.measured?.width) || 0;
const defaultWidth = defaultNodeDimensions[node.type as NodeType]?.width ?? 250;
const headerWidth = nodeWidth || measuredWidth || defaultWidth;
return (
<FloatingNodeHeader
@ -2071,7 +2076,7 @@ export function WorkflowCanvas() {
type={node.type as NodeType}
data={node.data}
position={node.position}
width={nodeWidth}
width={headerWidth}
selected={!!node.selected}
title={getNodeTitle(node)}
customTitle={node.data?.customTitle}

Loading…
Cancel
Save