Skip to content

Conversation

@joshlarson
Copy link
Contributor

@joshlarson joshlarson commented Jan 7, 2026

Screenshot 2026-01-06 at 7 51 33 PM Screenshot 2026-01-06 at 7 55 02 PM

In both cases, before on the left; after on the right.


Things to note:

  • Vehicle status!
  • If the vehicle is at a station, then that station is removed from the list, so it doesn't show "Now at Butler" and then also show a time for Butler.
  • No more count of how many stops away - it simply shows "Show/Hide More Stops". (Because how many stops away is ambiguous if a train isn't actually at a station).
  • Goodbye "Hello we are your " message 🥲

Asana Ticket: [SF/UD] All Modes: Show vehicle status at the top of trip details

@joshlarson joshlarson requested a review from a team as a code owner January 7, 2026 01:01
@joshlarson joshlarson force-pushed the jdl/sf2.0/ud/vehicle-status-in-trip-details branch from dfe1ad4 to c3757b1 Compare January 7, 2026 01:05
defstruct [
:stops
]

Copy link
Collaborator

Choose a reason for hiding this comment

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

I recommend adding a @type spec here and to TripStop, as it'll make it clearer that stops is actually a list of TripStop

@type t :: %__MODULE__{
  stops: [__MODULE__.TripStop.t()]
}

# in TripStop
@type t :: %__MODULE__{
  cancelled?: boolean(),
  # and the rest
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@@ -0,0 +1,43 @@
defmodule Dotcom.ScheduleFinder.TripDetails do
@moduledoc """
A struct representing trip details, including a list of stops visited before and after
Copy link
Collaborator

Choose a reason for hiding this comment

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

You technically took away the stops before/after distinction here, so this comment is a little confusing 😅

Copy link
Contributor Author

Choose a reason for hiding this comment

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

time: PredictedSchedule.display_time(ps)
}
end)
|> Enum.sort_by(& &1.time)
Copy link
Collaborator

Choose a reason for hiding this comment

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

|> Enum.sort_by(& &1.time, DateTime)

Copy link
Collaborator

Choose a reason for hiding this comment

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

do we need to reject timeless predictions here? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed the sorting, and added a test that I think shows that we don't need to reject timeless predictions

do: "Now at #{stop_name}"

defp vehicle_message(nil),
do: "Finishing another trip"
Copy link
Collaborator

Choose a reason for hiding this comment

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

don't forget translation here!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Too late - I forgot!

Thanks for reminding me 😇!

@joshlarson joshlarson requested a review from thecristen January 9, 2026 20:04
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.

3 participants