From d12e293d59c5ce66760346fceb447149e95d2daf Mon Sep 17 00:00:00 2001 From: shrimbly Date: Tue, 3 Mar 2026 08:15:13 +1300 Subject: [PATCH] fix: FloatingNodeHeader width prefers measured over stale style value MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The header width calculation was preferring node.style.width (set at creation time, often stale) over node.measured.width (actual DOM size). This caused headers to be narrower than nodes after image generation or manual resizing. Now uses measured → style → default fallback chain, matching the existing pattern used elsewhere in the file. Co-Authored-By: Claude Opus 4.6 --- src/components/WorkflowCanvas.tsx | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/components/WorkflowCanvas.tsx b/src/components/WorkflowCanvas.tsx index 3964de56..77a4daae 100644 --- a/src/components/WorkflowCanvas.tsx +++ b/src/components/WorkflowCanvas.tsx @@ -2060,14 +2060,8 @@ export function WorkflowCanvas() { // Groups don't get floating headers if (node.type === "group") return null; - 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; + const headerWidth = node.measured?.width || (node.style?.width as number) || defaultWidth; return (