Repository navigation
Phone app: the day's map with its route - #12
Merged
Merged
Conversation
A map band sits above the day's plan and stays put while the list scrolls, so dragging the map never fights the page. It can be hidden (remembered) or opened full screen; Android back closes full screen first. Tapping a pin scrolls to its card; tapping a card brings its pin into view. In full screen a tapped pin shows what it is (a tour stop names itself and its tour) with a way back to the plan. Pins, route lines and tour stops come from lib/mapLayers.ts, now shared with the desktop map, so both draw the same thing. Route shapes are read from the trip file; without network the map falls back to a plain background, keeping pins and routes readable offline. MapLibre loads only once a trip is opened. The morning's hotel pin is left out when a card sits at the same spot (a tour picking you up at the hotel), where it hid that card's numbered pin. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3 of 4 tasks
The phone map now draws Google's tiles (Map Tiles API) when the APK is built with NEXT_PUBLIC_GOOGLE_MAPS_API_KEY in .env.local, the desktop app's browser key. Without it, or when Google can't be reached, it falls back to OpenFreeMap, and offline to the plain background with pins and routes. The Map Tiles session is reused for its lifetime, dark mode gets a dark Google look, and the map shows Google's logo with the copyright for the area in view. Only that one variable is exposed to the build; the source never contains a key. README and .env.example say the key ends up inside such an APK, so it should not be shared. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Stage 1 of maps in the phone app: each day shows its map and route, like the desktop board.
Layout and UX
1.1/1.2pins for tour stops, dashed or routed lines.Under the hood
lib/mapLayers.ts: pins, lines and tour stops moved out ofcomponents/TripMap.tsxand shared by desktop and phone (with tests). The day colours moved there too.mobile/src/MapView.tsx: MapLibre + OpenFreeMap tiles (no API key), dark style in dark mode. Route shapes come from the trip file, so they need no network.Not yet (stage 2): downloading the map tiles of the trip's area for offline use.
Test plan
bun run typecheck,eslint(repo, minus build outputs),bun run test:coverage(194 tests),bun run build,bun run build:mobile🤖 Generated with Claude Code