Skip to content

feat(flights): port the travel map as /flights (WYA-235) - #2

Merged
charlesponti merged 4 commits into
mainfrom
linear/wya-235
Oct 31, 2026
Merged

charlesponti merged 4 commits into
mainfrom
linear/wya-235

Conversation

@charlesponti

@charlesponti charlesponti commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

Refs WYA-235. Brings the standalone travel map into Earth as the /flights route.

What changed

  • Data: app/data/flights.json is 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.
  • Map: app/components/FlightMap.tsx renders 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.tsx extracts Earth's existing basemap/style/navigation setup; MapLibreViewer now uses it too instead of duplicating MapLibre config.
  • Route UI: app/routes/flights.tsx is a full-screen map with a side panel containing the lifetime stats, year filters, selected-leg detail and the scrollable leg list. /flights opts out of the TfL map + detail-sheet shell in root.tsx; every other route keeps the existing shell.
  • Filtering: ?years=YYYY drives 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.
  • CI: added pnpm test to the workflow and a tests/flights.test.tsx suite using Node's test runner + tsx.

Acceptance criteria → evidence

  • Every leg renders; rendered count equals data count — tests/flights.test.tsx renders the real route at /flights and asserts 41 data-leg-id rows = flights.json.legs.length (41); the map receives the same leg array. Dev-server SSR also returns 41 rows.
  • Year filter shows only that year; clearing restores all — the test loops every year present in the data, asserts the exact set of rendered legs for /flights?years=<year>, and asserts /flights restores all 41. Dev-server spot checks: 2019 → 7 legs, 2024 → 5 legs.
  • Stats match flights.json exactly — FlightStats reads the stats block directly; the test asserts 41, 78,104, 30, 11, 2016—2026 are rendered. No stats computation is applied.
  • No regressions — smoke-tested / 200, /places 200, /flights 200; /tfl keeps its pre-existing 302 → /.
  • Source untouched — only flights.json was copied out of the reference app; the standalone parcel dashboard was not touched.

Notes

  • The authored stats totals 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.
  • Headless Chrome confirms the client map mounts (MapLibre canvas present) and the route renders with the side panel at desktop and mobile widths.
  • WYA-236 also adds a standalone-route bypass in root.tsx and test-runner entries in package.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

pnpm lint
pnpm typecheck
pnpm test        # 8 passing
pnpm build

Manual: open /flights, step through each year chip, use "All", then tap a route to see its detail card and framing.

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
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-30T18:54:04.809975Z 25b6047 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread app/root.tsx Resolved
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.
@charlesponti charlesponti changed the title feat: port the flight travel map as /flights feat(flights): port the travel map as /flights (WYA-235) Oct 30, 2026
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.
@charlesponti
charlesponti merged commit 420ad5c into main Oct 31, 2026
1 check passed
@charlesponti
charlesponti deleted the linear/wya-235 branch October 31, 2026 13:06
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