Repository navigation
feat(web): map gestures, dropped-pin actions and swipe-away place cards on mobile - #740
Merged
Merged
Conversation
…ds on mobile On a phone, every tap on empty map dropped a gray pin, even when the user only wanted to put a card away, and there was no touch way to reach the desktop context menu's actions. - Touch: a tap on empty map only puts the dropped pin or the open place away; a long-press (500 ms, cancelled by panning or a second finger) drops the pin. Pickers, map tools and active guidance still take precedence. Mouse clicks are unchanged. - The dropped-pin card on phones carries the context menu's actions as a row: Directions, From here, Share, Save parking, Copy, Details. Both share the route, details and share logic in lib/locationActions. The card rests above an open sheet or the map footer, so the map credits stay readable. - A place (card or standalone panel) closes when its sheet is swiped down from its lowest detent. The closing snap point only exists while the sheet rests there, so a quick flick from higher up lowers it instead of closing it. Lists and directions keep their lowest detent as the floor. - The theme-color tags (status bar) follow the theme chosen in settings, not only the system scheme. - Haptics skip vibration before the page's first tap, which Chrome refuses.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed and why
Follow-up to #739, aimed at making the map feel like a native map app on a phone.
Tap and long-press on the map (touch only; mouse behaviour is unchanged)
Dropped-pin card on phones
lib/locationActions.ts.Swipe a place away
swipe-to-dismisssnap point, turned into anonDismisscallback because our sheets aren't dialogs.Status bar colour
theme-colortags followed only the system colour scheme. With Dark chosen in settings on a phone set to light, the app had a bright green bar above a dark UI.ThemeColorSyncnow points both tags at the chosen theme and restores them when System is chosen again.Smaller
lib/closeSurfaces.tsnow holds the "close the place / close the panel" steps. Back restore, tap-to-dismiss and swipe-to-dismiss all use it.Verification
lib/mapTouch(long-press timing, jitter tolerance, cancellation, markers, the post-long-press click, touch detection);MapClickHandler(mouse click drops a pin; touch tap dismisses; long-press drops; pickers and guidance win);themeColor.pnpm exec vitest run --project web: 5752 passed. The 8 failures inuseNavJunctions.test.tsxandCategoryResultMarkers.test.tsxalso fail on an unmodified checkout in this environment.tsc --noEmitpasses for web andtsconfig.integrations.json.biome check . --diagnostic-level=error, Prettier on the changed docs andpnpm check-translationspass (no new strings).pnpm check-dead-codereports nothing inapps/web.next dev, 390×844, real touch events sent through the Chrome DevTools protocol, no API backend:theme-colortags to#1c1c1c, and System restored them;Release and upgrade impact
No migration or operator action. On touch screens a tap on the map no longer drops a pin; a long-press does.