From d6a8e60ffbd4514be9176ea367928919f68fa9c2 Mon Sep 17 00:00:00 2001 From: Pouyan Jahangiri Date: Sun, 26 Jul 2026 16:08:56 -0700 Subject: [PATCH] Open the phone bench framed on a single world On a phone the lineage canvas now opens framed on one world - readable, centred, and clear of the floating pill - rather than fitting the whole tree. Centring the whole tree only landed on a clean node by luck; it broke the moment the tree was a different shape or size. The rest of the tree is a pan away. Desktop keeps the whole-tree overview. --- src/lib/components/bench/LineageCanvas.svelte | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/lib/components/bench/LineageCanvas.svelte b/src/lib/components/bench/LineageCanvas.svelte index ae8f5a3..7d2afa1 100644 --- a/src/lib/components/bench/LineageCanvas.svelte +++ b/src/lib/components/bench/LineageCanvas.svelte @@ -234,7 +234,13 @@ canvas.reset(); return; } - const { minX, minY, maxX, maxY } = treeBounds(bench.worlds); + // On a phone, OPEN framed on a single world - readable, centred, and clear of the pill - which + // reads as a clean default; the rest of the tree is a pan away. (Centring the whole tree only + // lands on a clean node by luck - it breaks the moment the tree is a different shape or size.) + // Desktop keeps the whole-tree overview. + const { minX, minY, maxX, maxY } = shell.narrow + ? treeBounds([bench.worlds[0]]) + : treeBounds(bench.worlds); const s = Math.min(1, (rect.width - 2 * MARGIN) / NODE_W); // 1 on anything but a narrow phone canvas.scale = s; canvas.tx = (rect.width - (maxX - minX) * s) / 2 - minX * s;