fix(map): keep the selected place findable on the map

Selecting a place no longer spiderfies a city-sized cluster: the reveal
only fans open bubbles of up to 12 stops, or stacks whose stops all share
one coordinate, so a zoomed-out trip with hundreds of places stays usable
(#2990).

The selected pin now carries a white border inside a pulsing blue ring on
both renderers (static under reduced motion), and the map measures the
place card instead of assuming a fixed 320px, so the selection pans the
pin above even a tall card on portrait tablets and eases it back out when
the card grows over it later (#2991).

Closes #2990
Closes #2991
This commit is contained in:
Maurice
2026-11-06 11:51:16 +01:00
parent d7c4324afc
commit 4c0583845a
26 changed files with 713 additions and 107 deletions
@@ -0,0 +1,27 @@
import { describe, expect, it } from 'vitest';
import { placeMarkerFrame, placeMarkerLook, SELECTED_MARKER } from './markerLook';
describe('placeMarkerFrame', () => {
it('MARKERLOOK-001: gives the selected pin the white border, blue ring and pulse class (#2991)', () => {
expect(placeMarkerFrame(true, '#ff0000')).toEqual({
borderColor: SELECTED_MARKER.border,
shadow: SELECTED_MARKER.ring,
className: SELECTED_MARKER.className,
});
expect(SELECTED_MARKER.ring).toContain('#0a84ff');
});
it('MARKERLOOK-002: keeps every other pin in its category colour, without the class', () => {
const frame = placeMarkerFrame(false, '#ff0000');
expect(frame.borderColor).toBe('#ff0000');
expect(frame.className).toBe('');
expect(frame.shadow).not.toContain('#0a84ff');
});
});
describe('placeMarkerLook', () => {
it('MARKERLOOK-003: draws a selected pin larger than a planned one, even when it was compact', () => {
expect(placeMarkerLook({ _compact: true }, true).size).toBeGreaterThan(placeMarkerLook({}, false).size);
expect(placeMarkerLook({ _compact: true }, false).showPhoto).toBe(false);
});
});