Skip to content

Conversation

@joshlarson
Copy link
Contributor

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

1 participant