Skip to content

feat(ScheduleFinderLive): use date picker - #3667

Open
thecristen wants to merge 15 commits into
mainfrom
cbj/departures-datepicker
Open

thecristen wants to merge 15 commits into
mainfrom
cbj/departures-datepicker

Conversation

@thecristen

Copy link
Copy Markdown
Collaborator

Scope

Asana Ticket: Two services tagged as "(Now)"

Implementation

Note

🤖 In my initial research, I had Copilot rewrite the services picker dropdown with different logic, to analyze the active dates for every service, then split/recombine based on common groups of dates. The end result was pretty cool, and solved the double (Now) issue, but the dropdown was arguably even more confusing.
None of that's in this PR, but it did help us commit to trying out this datepicker!

  • Reuses the existing Datepicker LiveComponent
    • No time input, only date
    • Custom formatting
    • Is also updated when a date link is clicked on (the link to today, or any links to holiday dates)
    • image
    • Only enables dates where the route is in service (in general, not specific to the viewed stop/direction)
    • image
  • Instead of rerunning the Services.Service.all_valid_dates_for_service/1 logic constantly, now we just do it once when parsing, and save it as part of the %Service{} struct.
  • DotcomWeb.ScheduleController.LineController only used services for the now-deleted Schedule Finder modal, so it should've been removed in chore: Remove old SF1.0 code #3654 ... well, now it's deleted here
  • Which let us remove Dotcom.ServicePatterns.services_for_route/1 and a bunch of helper functions around that
  • And removing the service dropdown itself let us remove a bunch more!

How to test (with screenshots)

Deploying on dev-blue so we can play with it on a few different routes. Some fun examples:

  • /departures/?route_id=CR-Foxboro&stop_id=place-bbsta&direction_id=0 A few outbound stops to Foxboro don't have service today, but will soon. Just like before, landing on that page will immediately show you the next scheduled trips. Fun fact there are only two games scheduled within the relevant service date range (not every weekend as the dropdown might suggest):
Before After
image image

Not all routes have services associated with holiday services. Some of the subways do, e.g. the Red Line:

image

@thecristen
thecristen requested a review from a team as a code owner November 4, 2026 19:38
@thecristen thecristen added the dev-blue Deploy to dev-blue label Nov 4, 2026
@thecristen
thecristen requested a review from joshlarson November 4, 2026 19:38
@smartling-github-connector smartling-github-connector Bot added the Not Ready for Translation Remove this when the PR is approved to trigger a Smartling translation job label Nov 4, 2026

@lvachon1 lvachon1 left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I like it! (non-blocking comment): The Hingham/Hull Ferry runs weekdays year-round, but will not run on Thanksgiving Thursday. Other adjusted holiday scheduled get called out, should an adjustment to zero also be included?
Screenshot 2026-11-05 at 11 16 25 AM

This branch was successfully deployed

1 active deployment
dev-blue — d2eba654 Deployed Nov 11, 2026 by thecristen via pr / Deploy to dev-blue #6347
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dev-blue Deploy to dev-blue Not Ready for Translation Remove this when the PR is approved to trigger a Smartling translation job

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants