diff --git a/docs/working/plans/2026-06-27-map-init-consolidation.md b/docs/working/plans/2026-06-27-map-init-consolidation.md index a00b2c6..18dbbbc 100644 --- a/docs/working/plans/2026-06-27-map-init-consolidation.md +++ b/docs/working/plans/2026-06-27-map-init-consolidation.md @@ -1,6 +1,6 @@ # Map Init Consolidation โ€” shared `MapUtils.initEntryMap()` -**Status:** ๐Ÿ“‹ Not started +**Status:** โœ… Complete (2026-06-27) > Plan type: `refactor` ยท Depth: Standard ยท Origin: deferred memory `project-map-init-refactor` (re-scoped 2026-06-27 after home/trip convergence) @@ -112,6 +112,7 @@ flowchart TD | `entries` | array | all | already-parsed `map_entries` from Twig | | `cardPrefix` | string \| null | trip, home active | `'entry-'`; omit/null โ†’ markers navigate to `entry.url` | | `storyMarkers` | bool | trip | render `createStoryMarker()` for `type === 'story'`; default dot markers | +| `markLatest` | bool | trip, home active | enlarge the final non-story entry's dot (default `true`); home highlights passes `false` so no marker is singled out in the shuffled set (added during execution โ€” preserves highlights' current all-equal dots) | | `fullscreen` | `{ btnId, colSelector }` \| null | trip, home active | wires the fullscreen toggle; null โ†’ no fullscreen | | `gpx` | `{ urls, use, autoconnect, sourcePrefix, journeyId }` \| null | trip, home active | forwarded to `renderGpxJourney`; null โ†’ skip | | `fit` | `{ padding, maxZoom, singleZoom }` | all | defaults `{60, 11, 10}`; highlights uses `maxZoom: 8`, `singleZoom: 8` | @@ -252,6 +253,15 @@ The function returns the map instance and internally does: construct map (`attri --- +## Execution Outcome (2026-06-27) + +All four units landed. `MapUtils.initEntryMap(opts)` added to `maplibre-utils.js` and bundled via `make build-assets`; `trip.html.twig`, both `home.html.twig` branches converted. Two notes from execution: + +- **`markLatest` opt added** โ€” the highlights branch rendered all dots equal (`createDotMarker(false)`), but the shared `isLatest = (i === length-1)` would have enlarged the last (shuffled) highlight. Added a `markLatest` flag (default `true`; highlights passes `false`) to preserve that. +- **Map instance exposed as `window.tripMap` / `window.homeMap`** โ€” `initEntryMap` returns the map, and the templates assign it to these globals. This is the affordance the existing Playwright specs (M7, M8) already assumed; wiring it up turned two perma-failing tests green, giving real regression coverage on the converted surfaces. + +**Test status:** `tests/ui/maps`, `tests/ui/home`, `tests/ui/trip`, `tests/ui/gpx` โ€” 38 passed. Remaining failures are pre-existing and out of scope: **M6** asserts `window.map` on the deferred `map.html.twig` (untouched this pass); **H1** is a parallel-load timing flake (passes 4/4 in isolation). Both fail identically on the pre-refactor baseline. + ## Sources & Research - Origin: memory `project-map-init-refactor` (deferral), re-scoped after `project-homepage-redesign` / home-trip convergence.