Skip to content

refactor(ScheduleFinderLive): unique service keys - #3476

Open
thecristen wants to merge 2 commits into
mainfrom
thecristen/fix-schedule-service-switching
Open

refactor(ScheduleFinderLive): unique service keys#3476
thecristen wants to merge 2 commits into
mainfrom
thecristen/fix-schedule-service-switching

Conversation

@thecristen

Copy link
Copy Markdown
Collaborator

Scope

Asana Ticket: 🛜 Departures | Service picker changes sometimes don't update page

Implementation

It was occasionally observed that switching the selected service didn't consistently update the displayed Daily Schedules in a timely fashion.

This PR has some tiny changes which will hopefully aid in facilitating a more consistent experience.

Note

I used Copilot to look into the issue and used its findings!

  1. Removed phx-update from the <select> - this should let LiveView actually update the selected attribute and let the server keep things in sync.
  2. Instead of selecting services by label (which may not be unique), create a unique identifier - in this case, based on date and label.
  3. Instead of sending an extra message to trigger loading the new set of departures, invoke that when selecting the service.

How to test

Since this was tricky to observe in the first place, it's also tricky to test! But please play with the service picker and confirm there's no regression there.

Selected service name isn't unique enough to select using Enum.find.
Additionally, instead of sending another message, call assign_departures directly
@thecristen
thecristen requested a review from a team as a code owner September 3, 2026 17:11
@thecristen
thecristen requested a review from jlucytan September 3, 2026 17:11
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