Skip to content

Tap map pins to preview and expand element details#8

Merged
dfalling merged 1 commit into
mainfrom
map-element-tap
May 27, 2026
Merged

Tap map pins to preview and expand element details#8
dfalling merged 1 commit into
mainfrom
map-element-tap

Conversation

@dfalling
Copy link
Copy Markdown
Owner

Summary

  • Tap a marker → bottom preview card (name, address, short description).
  • Tap the card → full-screen modal with photos, schedule, labels, and full description.
  • Tap elsewhere on the map → dismiss.

Detail data is fetched lazily by id (new ElementDetail query) so the bounds query stays lean. Apollo caches it, so re-tapping the same pin is instant.

Implementation notes

Both <Marker onPress> and <MapLibreMap onPress> are codegen BubblingEventHandlers, so the marker's "onPress" bubbles to the map's listener. The marker handler calls stopPropagation() to keep the map from clearing the selection we just set. Found by reading MLRNMapView.onMapClick in the native source.

src/graphql/__generated__/types.ts was updated by hand alongside the new .graphql file, since codegen needs an external schema path that isn't committed.

Test plan

  • Tap a pin → preview card appears with name/address/description
  • Tap the preview card → full-screen modal opens with photos, schedule, labels
  • Tap the × on the card → preview dismisses
  • Tap empty map → preview dismisses
  • Selected pin renders darker / slightly larger
  • Recenter button hides while a preview is open
  • bunx tsc --noEmit clean, bun run lint clean, bun run test passes

🤖 Generated with Claude Code

@dfalling dfalling enabled auto-merge (squash) May 27, 2026 21:09
Tapping a marker brings up a bottom preview card with name, address,
and a description snippet. Tapping the card opens a full-screen modal
with photos, schedule, labels, and the rest. Tapping elsewhere on the
map dismisses the preview.

Marker and Map onPress are both codegen BubblingEventHandlers, so the
marker's "onPress" bubbles to the map's onPress listener — handler
calls stopPropagation() to keep the map from clearing the selection
right after.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@dfalling dfalling merged commit 49d0e2d into main May 27, 2026
2 checks passed
@dfalling dfalling deleted the map-element-tap branch May 27, 2026 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant