feat(stammbaum): raise MAX_ZOOM 3→10 so phones can zoom in to read (#692)
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 <noreply@anthropic.com>
This commit is contained in:
@@ -31,13 +31,13 @@ describe('clampZoom', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('clamps above MAX_ZOOM down to MAX_ZOOM', () => {
|
it('clamps above MAX_ZOOM down to MAX_ZOOM', () => {
|
||||||
expect(clampZoom(5)).toBe(MAX_ZOOM);
|
expect(clampZoom(99)).toBe(MAX_ZOOM);
|
||||||
expect(clampZoom(3.0001)).toBe(MAX_ZOOM);
|
expect(clampZoom(MAX_ZOOM + 0.0001)).toBe(MAX_ZOOM);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('exposes the resolved zoom bounds', () => {
|
it('exposes the resolved zoom bounds', () => {
|
||||||
expect(MIN_ZOOM).toBe(0.25);
|
expect(MIN_ZOOM).toBe(0.25);
|
||||||
expect(MAX_ZOOM).toBe(3.0);
|
expect(MAX_ZOOM).toBe(10);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -9,9 +9,14 @@
|
|||||||
* project. See ADR-027 for why this is custom rather than a third-party library.
|
* 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 MIN_ZOOM = 0.25;
|
||||||
export const MAX_ZOOM = 3.0;
|
export const MAX_ZOOM = 10;
|
||||||
export const DEFAULT_ZOOM = 1;
|
export const DEFAULT_ZOOM = 1;
|
||||||
|
|
||||||
/** Minimum zoom a recentre will snap up to so the focal node's text is legible (OQ-005). */
|
/** Minimum zoom a recentre will snap up to so the focal node's text is legible (OQ-005). */
|
||||||
|
|||||||
Reference in New Issue
Block a user