Conversation
Re-implements the intent of the stale RES-1862_draggable_map branch on the current codebase (which already gained a static location map and Places autocomplete since that branch was written). The Mapbox geocoder switch bundled into the old branch is deliberately NOT included - that is RES-1858's concern. - GroupLocationMap becomes draggable: the marker is pinned to the map centre, dragging emits update:lat/update:lng, and a fresh geocode from the location field still recentres the map (with an epsilon guard so the parent echoing our own drag back down doesn't fight the user) - GroupAddEdit syncs the dragged coordinates and sends lat/lng with create/edit; the :id remount hack is gone (it would have destroyed and recreated the map on every drag) - API v2 group create/update accept optional lat/lng, which take precedence over the server-side geocode of the location text; country still comes from geocoding (or the existing record when the location text is unchanged). With an explicit pin, an ungeocodable location string is no longer fatal - the pin wins and country is left null - New partials.dragmap hint (en/fr/fr-BE) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TzY1phBjyT3HogpeS53zon
|
Preview: https://restarters-pr-895.fly.dev✅ Ready - restore and migrations succeeded.
|
|
This is a good one for the testing group to test - I'll share it with them. |
User-testing feedback on #895: dragging the map to move a centre-pinned marker was counter-intuitive, wheel-zoom moved the location, you couldn't pan without moving the pin, and the initial view was too far out. - The marker is draggable and is the location; panning and zooming (wheel or buttons) just move the view. - Start at zoom 16 on the location. - Help text is a small muted line below the map, like the form's other hints, and says to drag the pin. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Thanks @ngm, useful feedback. There wasn't a strong UX reason for dragging the map: pinning the marker to the centre was just simpler to build. Your suggestion is better, so I've switched to it (d574d6f):
The preview will rebuild with these changes, so the testing group can try it at https://restarters-pr-895.fly.dev once it's redeployed. |
|
@edwh Brilliant, thanks, this feels much nicer. Have deployed preview and reshared with the testers. One note: when trying to actually save a group, I get the error 'Group could not be edited'. Don't know if that's just a preview deployment issue, or a bug.
|
|





Re-implements #637 (RES-1863, draggable map for group create/edit) from scratch on the current codebase. The old branch was 1,240 commits behind and conflicted with the build system; it also bundled the Mapbox geocoder switch, which belongs to RES-1858 (#644) and is deliberately not included here.
Since #637 was written,
developgained a staticGroupLocationMappreview and Google Places autocomplete, so this PR is much smaller than the original:GroupLocationMapbecomes draggable: the marker is pinned to the map centre; dragging emitsupdate:lat/update:lng. A fresh geocode from the location field still recentres the map, with an epsilon guard so the parent echoing a drag back down doesn't fight the user. Apartials.dragmaphint invites the fine-tune.GroupAddEditsyncs the dragged coordinates and includeslat/lngin the create/edit payloads (string-cast — the store's FormData builder drops falsy values, which would eat a 0 coordinate). The:id-based remount hack is removed; it would have destroyed the map on every drag.POST /groupsandPATCH /groups/{id}accept optionallat/lng(validated numeric, in range, both-or-neither), which take precedence over the server-side geocode of the location text. Country still comes from geocoding, or from the existing record when the location text is unchanged. With an explicit pin, an ungeocodable location string is no longer fatal — the pin wins and the country is left null.Testing
GroupLatLngOverrideTest(6 tests): client coordinates win on create and edit; geocode fallback unchanged without them; out-of-range rejected; ungeocodable-location-with-pin succeeds; unchanged-location edit keeps existing coords.GroupLocationMap.test.js(5 tests): drag emits updates, marker follows, external geocode recentres, echo-guard, hint text.