Add location picker, live map, and song proposals/voting to Soundmarks
Location picker (admin panel create/edit form): address-search
autocomplete backed by the new backend geocode proxy, plus an
embedded Leaflet/OpenStreetMap map - search, click, or drag the pin
to set a soundmark's coordinates. Replaces raw lat/lon number inputs.
Map screen + live location (Nearby page): a real map showing a
live-updating "you are here" dot (tracks the existing watchPosition
feed) and pins for whatever soundmarks are currently in range,
alongside the existing text/card view - not a replacement for it.
Song proposals + voting (Nearby page): shows every proposal for the
detected soundmark with vote counts, a "Propose a song" button
(reuses the existing SongPicker), and a vote toggle per proposal.
Soundmarks with no anthem yet now show a "propose one" prompt instead
of a play button, so there's an actual path to making the first
proposal for a brand new soundmark.
OpenStreetMap over Google Maps per explicit choice - no API key/
billing setup required. leaflet + react-leaflet added; the default
marker icon bundler quirk (broken image paths once bundled - a
known issue with every bundler) is patched once via src/lib/leafletIcons.ts.
10 new tests (LocationPicker search/selection, SoundmarkMap smoke
tests, Nearby proposal/vote/propose flows and the "no anthem yet"
state) - 83 webapp tests passing overall. Verified live end-to-end
with a real Nominatim geocode search ("Eiffel Tower, Paris") and
real Chromium geolocation mocking rather than stubbed data - the
whole loop (create -> geocode -> place pin -> assign anthem -> detect
via live location -> see it on the map -> view proposals) worked with
zero console errors.
Co-Authored-By:
Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
Showing
| ... | @@ -12,9 +12,11 @@ | ... | @@ -12,9 +12,11 @@ |
| "test:watch": "vitest" | "test:watch": "vitest" | ||
| }, | }, | ||
| "dependencies": { | "dependencies": { | ||
| "leaflet": "^1.9.4", | |||
| "lucide-react": "^1.31.0", | "lucide-react": "^1.31.0", | ||
| "react": "^19.2.8", | "react": "^19.2.8", | ||
| "react-dom": "^19.2.8", | "react-dom": "^19.2.8", | ||
| "react-leaflet": "^5.0.0", | |||
| "react-router-dom": "^7.18.2" | "react-router-dom": "^7.18.2" | ||
| }, | }, | ||
| "devDependencies": { | "devDependencies": { | ||
| ... | @@ -22,6 +24,7 @@ | ... | @@ -22,6 +24,7 @@ |
| "@testing-library/jest-dom": "^6.9.1", | "@testing-library/jest-dom": "^6.9.1", | ||
| "@testing-library/react": "^16.3.2", | "@testing-library/react": "^16.3.2", | ||
| "@testing-library/user-event": "^14.6.3", | "@testing-library/user-event": "^14.6.3", | ||
| "@types/leaflet": "^1.9.22", | |||
| "@types/node": "^24.13.3", | "@types/node": "^24.13.3", | ||
| "@types/react": "^19.2.17", | "@types/react": "^19.2.17", | ||
| "@types/react-dom": "^19.2.3", | "@types/react-dom": "^19.2.3", | ||
| ... | ... |
src/lib/leafletIcons.ts
0 → 100644
Please
register
or
sign in
to comment