Skip to content

Turn on ferry realtime in SF 2.0#2994

Merged
lvachon1 merged 28 commits intomainfrom
lev/feat/sf/live_ferry_data
Mar 6, 2026
Merged

Turn on ferry realtime in SF 2.0#2994
lvachon1 merged 28 commits intomainfrom
lev/feat/sf/live_ferry_data

Conversation

@lvachon1
Copy link
Contributor

@lvachon1 lvachon1 commented Mar 3, 2026

Scope

Asana Ticket: ⛴️ Turn on ferry realtime in SF 2.0

Implementation

Added vehicle_id to vehicle info of trip details in predicted schedules. Added support for boat names in SF 2.0 predictions. Allowed real time predictions to show up on SF 2.0 for ferries.

Screenshots

Ferry predictions with boat names
Screenshot 2026-03-03 at 12 35 43 PM
Screenshot 2026-03-03 at 12 35 36 PM
Other predictions without vehicle names
Screenshot 2026-03-04 at 9 52 52 AM
Screenshot 2026-03-04 at 9 52 12 AM
Screenshot 2026-03-04 at 9 51 54 AM

How to test

Find predictions in the API:
https://api-dev-green.mbtace.com/predictions?filter[route]=Boat-F1
https://api-dev-green.mbtace.com/predictions?filter[route]=Boat-F2H

See them on SF2.0
http://localhost:4001/preview/schedules/Boat-F1/0?stop=Boat-Long
http://localhost:4001/preview/schedules/Boat-F2H/0?stop=Boat-Long

…les. Added support for boat names in predictions. Allowed ferrys to show real time predictions.
@lvachon1 lvachon1 requested a review from a team as a code owner March 3, 2026 17:38
@lvachon1 lvachon1 requested a review from joshlarson March 3, 2026 17:38
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.

There are several issues that I'd love to see resolved:

  1. It should be The Champion, not Boat Champion.
  2. The test failures and 500 issues need to be resolved (fortunately, I'm pretty sure those have the same culprit).
  3. I'd like to see test coverage for this feature; ideally one test that asserts that the boat label is set correctly for ferry, and another that asserts that it's omitted for other modes. See below for a more precise suggestion.
  4. There's nothing preventing boat_name from showing up for non-ferry departures. I tried doing a simple fix for the vehicle == nil issue, and saw the following:
Image Image Image

I would recommend pushing all of the logic (including the string manipulation of "CHAMPION" ==> "The Champion") into the backend under trip_details.ex, probably adding a field called boat_label or boat_name to vehicle_info (and getting rid of vehicle_id). Then TripDetails.trip_details/1 can set that to whatever the boat name is for ferry, and leave it nil for all other modes, you can test those things in trip_details_test.exs, and the LiveView can be really stupid about it:

<div :if={vehicle_info.boat_name}>{vehicle_info.boat_name}</div>

(I think I'm comfortable with strings like The Champion not being translated, though maybe that's a product/design question, because the whole thing is kind of a proper noun... I would expect to see a ship called El Campeón in Spain, not The Campeón, for instance, even if I was reading the page in English.)

@lvachon1 lvachon1 requested a review from joshlarson March 5, 2026 15:35
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 great and works great, as far as I can tell!

I left a whole host of code-style comments. My hunch is that most of them (probably all but the vehicle_info/add_vehicle_name one) will be fairly straightforward (and hopefully uncontroversial) to apply before merging, but for any that are either nontrivial or controversial, I don't think it's necessary to block this feature on them.

lvachon1 and others added 3 commits March 6, 2026 09:17
Changed accepted, thanks!

Co-authored-by: Josh Larson <jlarson@mbta.com>
Co-authored-by: Josh Larson <jlarson@mbta.com>
Co-authored-by: Josh Larson <jlarson@mbta.com>
@lvachon1 lvachon1 merged commit d8f6eed into main Mar 6, 2026
17 checks passed
@lvachon1 lvachon1 deleted the lev/feat/sf/live_ferry_data branch March 6, 2026 16:07
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