Repository navigation
feat(flights): port the travel map as /flights (WYA-235) - #2
Merged
Merged
Conversation
Carry the standalone travel map into Earth as a real route: commit flights.json verbatim, render every air and rail leg as a great-circle route on MapLibre, and add URL-driven year filters plus the lifetime stats block. - extract MapCanvas so the TfL map and flight map share one basemap setup - static-import the data for SSR; stats stay exactly as authored - add leg-count, year-filter, stats and great-circle tests to CI
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 25b604709c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Normalise the trailing slash before comparing the pathname, so a trailing-slash URL does not fall back into the TfL map and sheet shell.
Extract the pathname normaliser behind the /flights shell bypass and assert /flights, /flights/ and / all resolve as expected.
Assert a selected leg renders its detail card, and that selecting a leg outside the active year filter does not leak its detail or row.
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.
Refs WYA-235. Brings the standalone travel map into Earth as the
/flightsroute.What changed
app/data/flights.jsonis carried over verbatim from the source app (sha256 matches the original). The route reads it through a static import (app/lib/flights-data.ts) rather than an API route: the dataset is immutable, ~21 KB, and SSR can render the full leg list and stats without a client fetch.app/components/FlightMap.tsxrenders every leg as a great-circle LineString on MapLibre (air solid, rail dashed), with airport hubs sized by leg count and a selected-route highlight.app/components/MapCanvas.tsxextracts Earth's existing basemap/style/navigation setup;MapLibreViewernow uses it too instead of duplicating MapLibre config.app/routes/flights.tsxis a full-screen map with a side panel containing the lifetime stats, year filters, selected-leg detail and the scrollable leg list./flightsopts out of the TfL map + detail-sheet shell inroot.tsx; every other route keeps the existing shell.?years=YYYYdrives both the map and list, with an "All" reset. The parser also tolerates a comma list. A selected leg is?leg=T-001, so filtered/selected views are shareable.pnpm testto the workflow and atests/flights.test.tsxsuite using Node's test runner +tsx.Acceptance criteria → evidence
tests/flights.test.tsxrenders the real route at/flightsand asserts 41data-leg-idrows =flights.json.legs.length(41); the map receives the same leg array. Dev-server SSR also returns 41 rows./flights?years=<year>, and asserts/flightsrestores all 41. Dev-server spot checks: 2019 → 7 legs, 2024 → 5 legs.flights.jsonexactly —FlightStatsreads thestatsblock directly; the test asserts41,78,104,30,11,2016—2026are rendered. No stats computation is applied./200,/places200,/flights200;/tflkeeps its pre-existing 302 →/.flights.jsonwas copied out of the reference app; the standalone parcel dashboard was not touched.Notes
statstotals are 125,696 km / 78,104 mi while summing the legs gives 125,700 km / 78,106 mi (rounding). Per the ticket, the hardcoded block is carried and displayed as-is; this PR does not introduce a stats engine.root.tsxand test-runner entries inpackage.json/CI. This PR keeps its bypass scoped to/flights; expect a small merge conflict if both land, resolved by keeping both checks.Test plan
Manual: open
/flights, step through each year chip, use "All", then tap a route to see its detail card and framing.