feat(web): spatial platform picker (map + walk-sorted list)#16
Draft
i11v wants to merge 7 commits into
Draft
Conversation
|
🚀 Preview deployed: https://tablo-pr-16.i11v.workers.dev |
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.
What & why
Prague interchanges (Anděl = 9 platforms around one junction) are the product's hard case. Today a stop card offers an "All / nást. A / nást. B…" chip filter — it names a platform but never says where to stand. This replaces it (where wired) with a shared map + walk-sorted platform list picker: one tappable pin per platform beside a list sorted by walk time, kept in sync, surfaced on both surfaces — the stop card and inline in each search result.
How it's built
StopPlatformgainslat/lon;build.tskeeps each platform's own GTFS coords instead of averaging them into the node centroid. The index is a gitignored build artifact, regenerated at deploy — no committed-data change.lib/platforms.ts: purebuildPlatformPicksjoining index geo with the live board (rawplatform === codeso per-line metro codes match), sorted nearest-first. Reuses existinghaversineMetres/metresToWalkMinutes/reachTier/Origin.RealMap.tsx: static dark Leaflet map,divIconpins (no broken default-marker PNGs), "you" marker, dashed line to the selected pin, two-wayonSelect. Default-exported andReact.lazy'd — lands in its own chunk.PlatformPicker.tsx: map + walk-sorted list reusingRouteChip/VehicleIcon/Count.sheetadds a confirm bar;inlineadds per-row "Add" + "Add whole stop".MapIcon;StopCardgains optionalplatforms/origin/onPick/onWholeStop(chip filter stays as the fallback when absent, e.g.preview.tsx);App.tsxthreads them and re-scopes a card in place;search.tsxResultCardgets an expandable inline picker.Behaviour notes
Verification
bun run typecheck— clean (the TS11 messages are pre-existing Effect-LS info diagnostics in the untouched worker package).bun run test— 74 passing, incl. updatedbuild.test.ts(per-platform coords) and a newplatforms.test.ts(sort order, metro raw-code join, null-origin).bun run build:web— succeeds; Leaflet is a separate chunk (RealMap-*.js~152 kB +RealMap-*.css~15 kB) loaded only when a picker opens.bun run build:indexand interactivebun devsmoke could not run here — outbound fetch todata.pid.czis blocked by the environment network policy (HTTP 403) and there's no cached GTFS. The index regenerates at deploy; the build logic + schema-decode are exercised bybuild.test.ts. Manual smoke (map button → pick narrows card → re-open switches; search expand → add a platform; geo-off degrade) is still worth a pass in a networked env.Generated by Claude Code