From 0ff5472d3599b727e54cdbe7d72b494d8c785684 Mon Sep 17 00:00:00 2001 From: shrimbly Date: Tue, 3 Mar 2026 06:55:52 +1300 Subject: [PATCH] fix(46-04): floating header width tracks resized node width MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/components/WorkflowCanvas.tsx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/components/WorkflowCanvas.tsx b/src/components/WorkflowCanvas.tsx index efaf93b5..3964de56 100644 --- a/src/components/WorkflowCanvas.tsx +++ b/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 (