Skip to content

feat(UpcomingDepartures): use vehicle status#2926

Merged
thecristen merged 9 commits intomainfrom
cbj/sf2.0/vehicle-info
Feb 11, 2026
Merged

feat(UpcomingDepartures): use vehicle status#2926
thecristen merged 9 commits intomainfrom
cbj/sf2.0/vehicle-info

Conversation

@thecristen
Copy link
Collaborator

Scope

Asana Ticket: [SF/UD] Subway: 🐞 Use vehicle info to inform "Approaching"/"Arriving"/"Boarding"

Implementation

For each prediction, fetch the related vehicle. If that vehicle has a populated status and the vehicle's corresponding stop is the same as the stop we're viewing in SF2.0, then we use this to display "Approaching"/"Arriving"/"Boarding".

How to test

Note this change only affects subway lines.

I like to watch Upcoming Departures alongside the corresponding screens in Screenplay. Screenplay doesn't update the previews as frequently as our LiveView updates, but you can see matching statuses!

@thecristen thecristen requested a review from a team as a code owner February 4, 2026 19:29
@thecristen thecristen requested a review from lvachon1 February 4, 2026 19:29
Copy link
Contributor

@joshlarson joshlarson left a comment

Choose a reason for hiding this comment

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

I like the approach! It's a bit different from how I was originally thinking this would be done, but I actually like your overall approach better!

My comment about showing Approaching for too long / still using the time even when we have vehicle info, is blocking.

@thecristen thecristen requested a review from joshlarson February 9, 2026 14:19
@thecristen
Copy link
Collaborator Author

@joshlarson I refactored this enough that I feel like it may as well be a new PR 😵
I'll note we might still notice discrepancy between upcoming departure and trip details, since this change only impacts the former (trip details already used vehicle status! just slightly differently) -- likely we might want to reconcile the two at some point.

Copy link
Contributor

@joshlarson joshlarson left a comment

Choose a reason for hiding this comment

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

This looks mostly good! I made a few non-blocking suggestions, and raised a few issues. The only two that are blocking for me are that I'm pretty sure we shouldn't be using vehicle_at_stop_status to figure Arriving, and that I do want to see test coverage that validates all of the pattern-matchings for :boarding (I'm happy to pair on this!).

@thecristen thecristen enabled auto-merge (squash) February 11, 2026 17:01
@thecristen thecristen merged commit 8455134 into main Feb 11, 2026
17 checks passed
@thecristen thecristen deleted the cbj/sf2.0/vehicle-info branch February 11, 2026 18:41
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