15-Jun-2026 — index map navigation, back-nav caching, loading placeholder, and search result meta #203
build 697 — commit d97773f
What's new
Improvements to the route maps and site search (https://github.com/nbarrett/ngx-ramblers/issues/203):
- Map pins on the route index pages are clickable again and take you to the route.
- Returning to a map page is instant, instead of rebuilding each time.
- Maps show a tidy loading spinner while they prepare, rather than briefly showing the wrong location first.
- Search results show the date and the walk leader or event coordinator, and you can search by a leader's name.
At a glance
- Clicking a pin on any route or content index page that shows a map opens the page represented by that pin.
- Press Back from a route and the map page reappears immediately, already centred where it was.
- While a map loads you see a "Loading map..." spinner in the map area; the map then appears centred on the right place.
- Each search result shows its date and, for walks and events, the leader or coordinator's name.
- Typing a leader's name into search finds their walks and events, most recent first.
Where to find it
- Route maps: any route or content index page that is configured to show a map.
- Search: the magnifying glass in the header, and the full /search page.
How it behaves
- Pins: clicking a pin opens that route; hovering shows its name.
- Back navigation: the page and its map view are remembered for the session, so returning is instant with no reload or rebuild. If you are logged in and turn on "edit site", pages always load fresh so your edits are never served from the remembered copy, and saving a page refreshes it for everyone.
- Loading: the map area shows a spinner until the data is ready, then the map appears already framed on the routes. It no longer briefly shows a default location.
- Search meta: results list the date and, for walks and events, the leader or coordinator beneath the title; the same coordinator line now also appears on event cards. Recent walks and events are listed first; pages keep their relevance order.
How to try it out
- Open any route or content index page that shows a map and click any pin: it opens the page represented by that pin.
- Press Back: the map page returns instantly, centred as before.
- Refresh the page: you see a brief "Loading map..." spinner, then the map framed on the routes, with no wrong-location flash.
- Search a walk leader's name from the header: their walks and events appear, newest first, each showing its date and the leader or coordinator.
Technical changes
Index map (DynamicContentViewIndex / DynamicContentViewIndexMap):
- filteredPageContent() is memoised so it returns a stable reference unless searchText or the source content changes. Previously it built a fresh object every change-detection cycle, so the map's ngOnChanges rebuilt every Leaflet marker each cycle; a real pin click then destroyed the icon between mousedown and mouseup and the browser never fired a click.
- New MapViewCacheService stores the map's settled centre/zoom keyed by marker set
- provider + style + height. The fit now runs at mount, before the moveend listener attaches, so the view is captured explicitly once the map is ready and a return renders straight at the fitted view with no refit.
- While marker data loads the component shows an opaque placeholder card with a FontAwesome spinner instead of mounting Leaflet (Bootstrap spinner-border does not render in this build); the map mounts only once data is ready, pre-centred on the markers, so the default centre is never shown. The shared loading overlay was extracted into a MapLoadingOverlay component.
Content caching (ContentCacheService):
- Caches findByPath results and the computed album index (several server queries) for the session. Bypassed only while site edit mode is active (SiteEditService.active()), and cleared on any page-content create/update/delete.
Search (server site-search controller, SiteSearchService, search components):
- Event entries index fields.contactDetails.displayName into the haystack and return it as contactName; the popup and /search page render the date and the leader/coordinator on the meta line. groupResults orders walk and event groups most-recent-first by start date, undated last; group-event-card shows the coordinator line.