From 8f836dfefb2cd0a54d275c90461fd6c4d7c11585 Mon Sep 17 00:00:00 2001 From: Marcel Date: Fri, 29 May 2026 18:58:38 +0200 Subject: [PATCH] =?UTF-8?q?feat(stammbaum):=20raise=20MAX=5FZOOM=203?= =?UTF-8?q?=E2=86=9210=20so=20phones=20can=20zoom=20in=20to=20read=20(#692?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Zoom is normalised to the whole tree, so z=3 still renders a wide tree too small on a phone. Raise the ceiling to 10 (revises OQ-001); SVG stays crisp at any zoom so a generous max is harmless. Co-Authored-By: Claude Opus 4.8 --- frontend/src/lib/person/genealogy/panZoom.test.ts | 6 +++--- frontend/src/lib/person/genealogy/panZoom.ts | 9 +++++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/frontend/src/lib/person/genealogy/panZoom.test.ts b/frontend/src/lib/person/genealogy/panZoom.test.ts index ad9e8371..e881f6a4 100644 --- a/frontend/src/lib/person/genealogy/panZoom.test.ts +++ b/frontend/src/lib/person/genealogy/panZoom.test.ts @@ -31,13 +31,13 @@ describe('clampZoom', () => { }); it('clamps above MAX_ZOOM down to MAX_ZOOM', () => { - expect(clampZoom(5)).toBe(MAX_ZOOM); - expect(clampZoom(3.0001)).toBe(MAX_ZOOM); + expect(clampZoom(99)).toBe(MAX_ZOOM); + expect(clampZoom(MAX_ZOOM + 0.0001)).toBe(MAX_ZOOM); }); it('exposes the resolved zoom bounds', () => { expect(MIN_ZOOM).toBe(0.25); - expect(MAX_ZOOM).toBe(3.0); + expect(MAX_ZOOM).toBe(10); }); }); diff --git a/frontend/src/lib/person/genealogy/panZoom.ts b/frontend/src/lib/person/genealogy/panZoom.ts index 69c4af40..b306d095 100644 --- a/frontend/src/lib/person/genealogy/panZoom.ts +++ b/frontend/src/lib/person/genealogy/panZoom.ts @@ -9,9 +9,14 @@ * project. See ADR-027 for why this is custom rather than a third-party library. */ -/** Resolved zoom bounds (OQ-001). */ +/** + * Zoom bounds. OQ-001 originally resolved the ceiling to 3.0, but because zoom + * is normalised to the whole tree, z=3 still shows too much of a wide tree to be + * legible on a phone — so the ceiling was raised to 10 (product-owner revision, + * #692). SVG stays vector-crisp at any zoom, so a generous max is harmless. + */ export const MIN_ZOOM = 0.25; -export const MAX_ZOOM = 3.0; +export const MAX_ZOOM = 10; export const DEFAULT_ZOOM = 1; /** Minimum zoom a recentre will snap up to so the focal node's text is legible (OQ-005). */