Skip to content

[codex] Add display fields to arrivals#6

Merged
gtokman merged 2 commits into
mainfrom
codex/subway-arrival-display-fields
May 27, 2026
Merged

[codex] Add display fields to arrivals#6
gtokman merged 2 commits into
mainfrom
codex/subway-arrival-display-fields

Conversation

@gtokman
Copy link
Copy Markdown
Contributor

@gtokman gtokman commented May 27, 2026

Summary

Adds display-oriented arrival fields to mta-js so clients can render destination labels without decoding raw GTFS direction details.

Changes

  • Adds optional destination and displayDirection fields to Arrival.
  • Populates those fields for direct subway arrivals from static GTFS trip headsigns.
  • Populates those fields for direct BusTime arrivals from DestinationName.
  • Normalizes rider-facing L train east/west direction aliases to NYCT realtime south/north, including hosted API requests.
  • Documents the preferred arrival rendering fallback.

Why

MTA subway realtime uses NYCT north/south directions 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 test
  • bun run typecheck

@gtokman gtokman requested a review from Copilot May 27, 2026 04:36
@gtokman gtokman marked this pull request as ready for review May 27, 2026 04:36
Copy link
Copy Markdown

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

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

Comment thread index.ts Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 Arrival with optional destination and displayDirection fields and populates them for subway (static GTFS trip headsign) and bus (BusTime DestinationName) arrivals.
  • Normalizes L train east/west direction aliases to underlying realtime south/north directions, 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.

Comment thread index.ts
Comment thread README.md Outdated
@gtokman gtokman force-pushed the codex/subway-arrival-display-fields branch from 4468743 to b618c10 Compare May 27, 2026 04:42
@gtokman gtokman requested a review from Copilot May 27, 2026 04:42
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

Comment thread README.md Outdated
@gtokman gtokman force-pushed the codex/subway-arrival-display-fields branch from b618c10 to 94986f6 Compare May 27, 2026 04:45
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@gtokman gtokman merged commit 3222a7d into main May 27, 2026
2 checks passed
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.

2 participants