ux(map): place search with autocomplete flies the map #1192

Merged
chris merged 3 commits from feat/place-search-ui into main 2026-10-13 13:25:12 +02:00
Owner

Summary

Adds place search to the /map page by reusing the existing topbar search input. Typing two or more characters in the shared header field offers debounced gazetteer suggestions anchored directly under it; picking one flies the map to that place. This is a scope change from the earlier revision: the map-local overlay field is dropped and the suggestion UI now lives inside the header search.

UX

  • Suggestions are anchored under the existing AppHeader search input, not a separate field on the map.
  • Debounced ~300ms query, up to 8 rows, keyboard nav (up/down/enter/escape) with full ARIA combobox + listbox semantics.
  • Each row shows the place name prominently plus a grounded context line (level label + country code, no invented translations).
  • Selection flies the map with a level-appropriate zoom and keeps focus in the input. The dropdown closes on select.
  • Enter with no active suggestion runs the existing /search media submit unchanged, so the field still behaves as a media search everywhere.
  • Quiet states: subtle loading, a soft "no matches" line, and a quiet error line if the gazetteer is unreachable.

Design

  • AppHeader gains a single optional onPlaceSearchSelect prop. When present the input becomes a combobox and the suggestion list mounts; when absent (every other page) the input is byte-for-byte the plain media-search box it was before.
  • The callback reaches AppHeader through a new pageHeaderPlaceSearch store in pageMenu.ts, following the same pattern as the existing pageHeaderFilterSlot. The map page registers the fly handler on mount and clears it on destroy.
  • New TopbarPlaceSuggestions.svelte owns the debounced lookup, ARIA wiring, keyboard handling, and quiet states. It renders nothing until there is a real query, so non-map pages' header markup is untouched.
  • placeSearch.ts client and the existing fly logic are unchanged. The MapView overlay slot and the old MapPlaceSearch component are removed.

Testing

  • Typecheck, unit tests (207 passing), and production build all clean.
  • Playwright spec updated to drive the topbar input: suggests + flies on select, and preserves plain media-search Enter when no suggestion is active.
## Summary Adds place search to the `/map` page by reusing the existing topbar search input. Typing two or more characters in the shared header field offers debounced gazetteer suggestions anchored directly under it; picking one flies the map to that place. This is a scope change from the earlier revision: the map-local overlay field is dropped and the suggestion UI now lives inside the header search. ## UX - Suggestions are anchored under the existing AppHeader search input, not a separate field on the map. - Debounced ~300ms query, up to 8 rows, keyboard nav (up/down/enter/escape) with full ARIA combobox + listbox semantics. - Each row shows the place name prominently plus a grounded context line (level label + country code, no invented translations). - Selection flies the map with a level-appropriate zoom and keeps focus in the input. The dropdown closes on select. - Enter with no active suggestion runs the existing `/search` media submit unchanged, so the field still behaves as a media search everywhere. - Quiet states: subtle loading, a soft "no matches" line, and a quiet error line if the gazetteer is unreachable. ## Design - `AppHeader` gains a single optional `onPlaceSearchSelect` prop. When present the input becomes a combobox and the suggestion list mounts; when absent (every other page) the input is byte-for-byte the plain media-search box it was before. - The callback reaches `AppHeader` through a new `pageHeaderPlaceSearch` store in `pageMenu.ts`, following the same pattern as the existing `pageHeaderFilterSlot`. The map page registers the fly handler on mount and clears it on destroy. - New `TopbarPlaceSuggestions.svelte` owns the debounced lookup, ARIA wiring, keyboard handling, and quiet states. It renders nothing until there is a real query, so non-map pages' header markup is untouched. - `placeSearch.ts` client and the existing fly logic are unchanged. The `MapView` overlay slot and the old `MapPlaceSearch` component are removed. ## Testing - Typecheck, unit tests (207 passing), and production build all clean. - Playwright spec updated to drive the topbar input: suggests + flies on select, and preserves plain media-search Enter when no suggestion is active.
ux(map): place search with autocomplete flies the map
All checks were successful
Wiki Sync / Sync wiki from docs (push) Has been skipped
Build and Deploy / Detect changed services and test scopes (push) Successful in 2s
Build and Deploy / Android unit tests and debug APK (push) Has been skipped
Build and Deploy / Smoke API and media worker (push) Has been skipped
Build and Deploy / Smoke web (push) Has been skipped
Build and Deploy / Smoke ML worker (push) Has been skipped
Build and Deploy / Smoke people worker (push) Has been skipped
Build and Deploy / Build postgres image (push) Has been skipped
Build and Deploy / Build plants worker image (push) Has been skipped
Build and Deploy / Build converter worker image (push) Has been skipped
Build and Deploy / Deploy postgres (push) Has been skipped
Build and Deploy / Build API image (push) Has been skipped
Build and Deploy / Build media worker image (push) Has been skipped
Build and Deploy / Build ML worker image (push) Has been skipped
Build and Deploy / Build people worker image (push) Has been skipped
Build and Deploy / Build web image (push) Has been skipped
Build and Deploy / Deploy API (push) Has been skipped
Build and Deploy / Deploy web (push) Has been skipped
Build and Deploy / Deploy media worker (push) Has been skipped
Build and Deploy / Deploy ML worker (push) Has been skipped
Build and Deploy / Deploy plants worker (push) Has been skipped
Build and Deploy / Deploy people worker (push) Has been skipped
Build and Deploy / Deploy converter worker (push) Has been skipped
Build and Deploy / Clean Docker build artifacts (push) Has been skipped
Build and Deploy / Run scoped PR tests (push) Successful in 8m21s
4e9d4981e4
Add a discreet place-search overlay on the /map Leaflet map. It queries the
local GeoNames gazetteer (GET /api/places/search) with a debounced autocomplete
and flies the map to the selected place. Selection flies only — no media
filtering, no result markers, no new URL params.

- Top-left overlay via a new opt-in MapView slot (z-[600]); other MapView
  consumers are unaffected.
- Typed client apps/web/src/lib/api/placeSearch.ts with limit clamped 1..50.
- MapPlaceSearch.svelte: runes-based combobox, 300 ms debounce from 2 chars,
  max 8 suggestions, keyboard nav, ARIA combobox pattern, quiet loading/error/
  no-results states, localized level + countryCode context line.
- MapView flies via flyTo (or setView under prefers-reduced-motion), suppresses
  mid-flight move events, and emits the final viewport on landing moveend so
  page bounds/URL sync follow naturally.
- Level-appropriate zoom: country 5, admin_region 8, geographic_area 9,
  city 12, locality 13, venue 15 (default 11).
- New i18n keys in en/de/da.
ux(map): place search moves into the shared topbar search input
Some checks failed
Wiki Sync / Sync wiki from docs (push) Has been skipped
Build and Deploy / Detect changed services and test scopes (push) Successful in 3s
Build and Deploy / Android unit tests and debug APK (push) Has been skipped
Build and Deploy / Smoke API and media worker (push) Has been skipped
Build and Deploy / Smoke web (push) Has been skipped
Build and Deploy / Smoke ML worker (push) Has been skipped
Build and Deploy / Smoke people worker (push) Has been skipped
Build and Deploy / Build postgres image (push) Has been skipped
Build and Deploy / Build plants worker image (push) Has been skipped
Build and Deploy / Build converter worker image (push) Has been skipped
Build and Deploy / Deploy postgres (push) Has been skipped
Build and Deploy / Build API image (push) Has been skipped
Build and Deploy / Build media worker image (push) Has been skipped
Build and Deploy / Build ML worker image (push) Has been skipped
Build and Deploy / Build people worker image (push) Has been skipped
Build and Deploy / Build web image (push) Has been skipped
Build and Deploy / Deploy API (push) Has been skipped
Build and Deploy / Deploy web (push) Has been skipped
Build and Deploy / Deploy media worker (push) Has been skipped
Build and Deploy / Deploy ML worker (push) Has been skipped
Build and Deploy / Deploy plants worker (push) Has been skipped
Build and Deploy / Deploy people worker (push) Has been skipped
Build and Deploy / Deploy converter worker (push) Has been skipped
Build and Deploy / Clean Docker build artifacts (push) Has been skipped
Build and Deploy / Run scoped PR tests (push) Failing after 8m54s
60ba5cee9e
Scope change: drop the map-local overlay field and hang place suggestions off
the existing AppHeader search input on /map.

- Add TopbarPlaceSuggestions.svelte: debounced gazetteer suggestions anchored
  under the header input, ARIA combobox/listbox, keyboard nav, quiet loading/
  empty/error states. Renders nothing until there is a query, so every other
  page's header markup is untouched.
- AppHeader gains an optional onPlaceSearchSelect prop; when present the input
  becomes a combobox, otherwise it stays a plain media-search box.
- AppShell reads the new pageHeaderPlaceSearch store and passes the callback to
  the desktop AppHeader. Map page registers it in onMount, clears in onDestroy.
- Enter with no active suggestion still runs the existing /search media submit.
- Removing MapView overlay slot + MapPlaceSearch; keeping placeSearch client and
  fly logic. Drop mapPlaceSearchPlaceholder/Hint (header supplies its own).
ux(map): mobile topbar disclosure, list hygiene, cold-start-stable e2e
All checks were successful
Wiki Sync / Sync wiki from docs (push) Has been skipped
Build and Deploy / Detect changed services and test scopes (push) Successful in 3s
Build and Deploy / Android unit tests and debug APK (push) Has been skipped
Build and Deploy / Smoke API and media worker (push) Has been skipped
Build and Deploy / Smoke web (push) Has been skipped
Build and Deploy / Smoke ML worker (push) Has been skipped
Build and Deploy / Smoke people worker (push) Has been skipped
Build and Deploy / Build postgres image (push) Has been skipped
Build and Deploy / Build plants worker image (push) Has been skipped
Build and Deploy / Build converter worker image (push) Has been skipped
Build and Deploy / Deploy postgres (push) Has been skipped
Build and Deploy / Build API image (push) Has been skipped
Build and Deploy / Build media worker image (push) Has been skipped
Build and Deploy / Build ML worker image (push) Has been skipped
Build and Deploy / Build people worker image (push) Has been skipped
Build and Deploy / Build web image (push) Has been skipped
Build and Deploy / Deploy API (push) Has been skipped
Build and Deploy / Deploy web (push) Has been skipped
Build and Deploy / Deploy media worker (push) Has been skipped
Build and Deploy / Deploy ML worker (push) Has been skipped
Build and Deploy / Deploy plants worker (push) Has been skipped
Build and Deploy / Deploy people worker (push) Has been skipped
Build and Deploy / Deploy converter worker (push) Has been skipped
Build and Deploy / Clean Docker build artifacts (push) Has been skipped
Build and Deploy / Run scoped PR tests (push) Successful in 8m15s
1a42e971d3
CI run 4584 failed the place-search spec on both projects:

- mobile: the header input is desktop-only (the small-screen bar had a
  search *icon link*), so the feature was unreachable. AppShell now passes
  the place-search callback to the mobile header too, where the icon
  becomes a disclosure for an inline full-width field — same
  TopbarPlaceSuggestions, same fly-on-select, Enter still falls through to
  /search. The expanded field owns the whole row; X or Escape collapses it
  and hands focus back to the toggle.

- desktop: both tests failed only on first run and passed on retry — a
  cold preview server served the DOM before Svelte attached handlers, so
  Enter fired into nothing. The spec now gates on client boot (the map's
  onMount promotes the header input to role=combobox; the Leaflet
  container must exist before a fly can be observed) instead of racing
  the load event.

Two defects found while verifying the mobile design:

- clicking away left the suggestion list stranded open (the panel's
  focusout never fires because focus never enters the panel); blur on the
  field now dismisses it, and refocusing brings it back
- the status line said "No matches" even when results were shown; it now
  only appears when there is nothing to list
- the narrow-viewport list slid under MapView's z-[500] split toggle; the
  mobile header outranks it exactly while the list is on screen
chris merged commit 134a9fc0c1 into main 2026-10-13 13:25:12 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
chris/memories!1192
No description provided.