-
Notifications
You must be signed in to change notification settings - Fork 16
feat(SF2.0/UpcomingDepartures): Fancy labels for Commuter Rail predictions #2853
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
7d5b675 to
cc2d9a7
Compare
a55dfbf to
8b0489a
Compare
| |> case do | ||
| nil -> nil | ||
| "Commuter Rail" -> nil | ||
| name -> name |> String.trim("Commuter Rail - ") | ||
| end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a similar function in Dotcom.ScheduleFinder, I wonder if we should start sharing here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I was thinking the same thing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...however, could we treat that as a follow-up? The two implementations aren't exactly compatible with each other, and I'm not sure about blocking this (and the various PR's that have stacked up behind this) on reconciling them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| defp arrival_substatus(%{ | ||
| predicted_schedule: %PredictedSchedule{schedule: nil} | ||
| }), | ||
| do: :on_time |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this compare the time? Otherwise wouldn't we risk rendering "on time" when showing a status-less added trip that doesn't happen to be on time?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm. What should it say when a trip has been added? I guess "Added" would be a reasonable choice... I defaulted to "on time", because when a trip doesn't have a schedule, then it definitely hasn't gotten off that schedule.
Can ask Chase, and/or add this to the list of assumptions in Notion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure, I recommend asking. IMO I don't think "Added" would be meaningful, and maybe this is a case for no status
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Chase is out of office until next week - shall we come up with a stop-gap guess until he comes back?
| }), | ||
| headsign: trip.headsign, | ||
| platform_name: platform_name(predicted_schedule), | ||
| status: predicted_schedule |> PredictedSchedule.status(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you need this field? I'm not sure if you're using upcoming_departure.status directly (you read the same value into arrival_substatus)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh oops - I added this for debugging and forgot to remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bye!
Before
After
Other Examples
Off-Schedule
Status Lifted from the Prediction
Asana Ticket: [SF/UD] CR: Show train number, track number, and status when available, and HH:MM instead of N min