Skip to content

fix(UpcomingDepartures): Show crossed out scheduled time for Delayed status#2934

Merged
joshlarson merged 2 commits intomainfrom
jdl/sf2.0/show-crossed-out-time-for-delayed-status
Feb 11, 2026
Merged

fix(UpcomingDepartures): Show crossed out scheduled time for Delayed status#2934
joshlarson merged 2 commits intomainfrom
jdl/sf2.0/show-crossed-out-time-for-delayed-status

Conversation

@joshlarson
Copy link
Contributor

@joshlarson joshlarson commented Feb 9, 2026

Scope

Asana Ticket: [SF/UD] 🐞 A status of "Delayed" should still show the crossed-out original time if scheduled and predicted times are more than a minute apart

Implementation

  • Just some fiddling with function pattern-matching.

Screenshots

Screenshot 2026-02-09 at 4 39 05 PM

(Before on the left; After on the right)

How to test

This is tricky to test. You could try to use LiveBook or IEx to find a prediction with a Delayed status:

2
|> Routes.Repo.by_type()
|> Enum.map(& &1.id)
|> Enum.flat_map(&Predictions.Repo.all(route: &1))
|> Enum.filter(&(&1.status == "Delayed"))

but Delayed-status predictions happen somewhat infrequently, so you could be waiting for a while.

...or you can hack Predictions.Repo.all/1 to make all predictions have the Delayed status by tacking on 👇 to the end (please don't commit this!):

|> Enum.map(fn %Predictions.Prediction{} = p ->
  %Predictions.Prediction{p | status: "Delayed"}
end)

(this is how I got the screenshots above - the 5:40 train is actually on time 😏)

Good luck!


@joshlarson joshlarson requested a review from a team as a code owner February 9, 2026 21:44
@joshlarson joshlarson requested a review from jlucytan February 9, 2026 21:44
@joshlarson joshlarson enabled auto-merge (squash) February 9, 2026 21:57
Copy link
Collaborator

@thecristen thecristen left a comment

Choose a reason for hiding this comment

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

The test titles and PR description helped explain to me why this change is desired. LGTM :)

@joshlarson joshlarson merged commit 60600c2 into main Feb 11, 2026
17 checks passed
@joshlarson joshlarson deleted the jdl/sf2.0/show-crossed-out-time-for-delayed-status branch February 11, 2026 21:08
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