From fe62934be773fbf81cb70a00aa69ea1a10545a74 Mon Sep 17 00:00:00 2001 From: G30 <50341825+silentoplayz@users.noreply.github.com> Date: Tue, 11 Aug 2026 01:23:31 -0400 Subject: [PATCH] fix: derive overview node spacing from rem so branches never overlap (#27995) --- src/lib/components/chat/Overview/View.svelte | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lib/components/chat/Overview/View.svelte b/src/lib/components/chat/Overview/View.svelte index ddfb884056..edd0f48571 100644 --- a/src/lib/components/chat/Overview/View.svelte +++ b/src/lib/components/chat/Overview/View.svelte @@ -65,8 +65,11 @@ const drawFlow = async (direction: LayoutDirection) => { const nodeList: Node[] = []; const edgeList: Edge[] = []; - const levelOffset = direction === 'vertical' ? 150 : 300; - const siblingOffset = direction === 'vertical' ? 250 : 150; + const rootFontSize = parseFloat(getComputedStyle(document.documentElement).fontSize) || 16; + const nodeWidth = 15 * rootFontSize; + const nodeHeight = 5 * rootFontSize; + const levelOffset = direction === 'vertical' ? nodeHeight + 70 : nodeWidth + 60; + const siblingOffset = direction === 'vertical' ? nodeWidth + 60 : nodeHeight + 70; // Map to keep track of node positions at each level let positionMap = new Map();