From 66a0fb01a2f9eeb49993e267acee022d5f535f84 Mon Sep 17 00:00:00 2001 From: chihlasm Date: Wed, 18 Feb 2026 03:21:43 -0500 Subject: [PATCH] fix: stop connector fork line from overlapping child cards Replace the two-element approach (separate fork line + child lanes div with mismatched maxWidth values) with a single relative-positioned container. The fork line is absolutely positioned and its left/right are calculated from the number of children so it spans exactly from the center of the first lane to the center of the last lane. Co-Authored-By: Claude Sonnet 4.6 --- .../src/components/tree-editor/TreeCanvas.tsx | 42 ++++++++++--------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/frontend/src/components/tree-editor/TreeCanvas.tsx b/frontend/src/components/tree-editor/TreeCanvas.tsx index ecb00322..a89cfd25 100644 --- a/frontend/src/components/tree-editor/TreeCanvas.tsx +++ b/frontend/src/components/tree-editor/TreeCanvas.tsx @@ -619,29 +619,31 @@ export function TreeCanvas() { ) : ( // Multiple children: horizontal branching -
- {/* Horizontal fork line */} + // The fork line and child lanes share the same flex container so the + // line is sized by the actual rendered children, not a hardcoded estimate. +
+ {/* Horizontal fork line — absolutely positioned, aligned to child centers. + Spans from center of first lane to center of last lane. */}
- {/* Child lanes */} -
- {orderedChildren.map(({ child, optionLabel: ol, childIndex }) => ( -
- {/* Vertical stub into child lane */} -
- {renderNode(child, node.id, childIndex, ol)} -
- ))} -
+ {orderedChildren.map(({ child, optionLabel: ol, childIndex }) => ( +
+ {/* Vertical stub into child lane */} +
+ {renderNode(child, node.id, childIndex, ol)} +
+ ))}
)}