[codex] Add display fields to arrivals#6
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4468743017
ℹ️ 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".
There was a problem hiding this comment.
Pull request overview
Adds destination/display-focused metadata to Arrival objects and normalizes direction inputs for the L train so client UIs can render rider-facing labels without having to interpret NYCT realtime direction quirks.
Changes:
- Extends
Arrivalwith optionaldestinationanddisplayDirectionfields and populates them for subway (static GTFS trip headsign) and bus (BusTimeDestinationName) arrivals. - Normalizes L train
east/westdirection aliases to underlying realtimesouth/northdirections, including hosted API requests. - Adds README guidance and tests covering the new fields and L alias normalization.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/types.ts | Adds destination and displayDirection to the Arrival type. |
| README.md | Documents display-oriented arrival rendering and L direction alias behavior. |
| index.ts | Populates new arrival display fields; normalizes L alias directions before filtering/requests. |
| index.test.ts | Adds coverage for L alias normalization (local + hosted) and new arrival fields. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
4468743 to
b618c10
Compare
b618c10 to
94986f6
Compare
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Summary
Adds display-oriented arrival fields to
mta-jsso clients can render destination labels without decoding raw GTFS direction details.Changes
destinationanddisplayDirectionfields toArrival.DestinationName.east/westdirection aliases to NYCT realtimesouth/north, including hosted API requests.Why
MTA subway realtime uses NYCT
north/southdirections even on east-west lines like the L. This makes client UIs easy to get wrong. The SDK should expose destination-ready fields and handle the common L train alias case directly.Validation
bun testbun run typecheck