feat(stammbaum): mobile read path — pan, zoom, fit-to-view (#692) #694

Merged
marcel merged 39 commits from feat/issue-692-stammbaum-mobile-panzoom into main 2026-05-30 07:43:44 +02:00
2 changed files with 10 additions and 5 deletions
Showing only changes of commit 8f836dfefb - Show all commits

View File

@@ -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);
});
});

View File

@@ -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). */