Skip to content

Conversation

@joshlarson
Copy link
Contributor

Scope

Asana Ticket: ❗[AM Alerts] 🐞 Directional alerts are shown on both directions of the line diagram

Implementation

  • Add another utility function called matchesDirection for alerts, and use it to filter alerts before they're passed into the <LineDiagram /> component.
    • This had to happen in <ScheduleDirection /> or downstream of there, because when you switch directions on the line diagram page, the direction ID change is captured in state, but not in the direction ID passed in to the component (which is what's available upstream of <ScheduleDirection />). If we did the filtering anywhere upstream of <ScheduleDirection /> (e.g. in <SchedulePage />), then the alerts that are visible on the line diagram would be based on which direction you were looking at when you first navigated to the page, not what direction you're looking at now.

Screenshots

Screenshot 2026-02-02 at 4 04 16 PM

Note the same line diagram in the other direction:

Screenshot 2026-02-02 at 4 05 00 PM

How to test

Create a station bypass or suspension that only affects a single direction, and visit the line diagram page for the affected route and switch directions.

@joshlarson joshlarson requested a review from a team as a code owner February 2, 2026 21:53
@joshlarson joshlarson requested a review from thecristen February 2, 2026 21:53
Copy link
Collaborator

@thecristen thecristen left a comment

Choose a reason for hiding this comment

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

Yea, solid!

@joshlarson joshlarson enabled auto-merge (squash) February 3, 2026 20:15
@joshlarson joshlarson merged commit 28d2a1a into main Feb 3, 2026
17 checks passed
@joshlarson joshlarson deleted the jdl/fix/dont-show-wrong-direction-alerts-on-line-diagram branch February 3, 2026 20:27
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