Skip to content

Conversation

@nikkisato
Copy link

Screenshot 2025-12-16 140625

Using https://www.opentripplanner.org/otp-ui/?path=/story/itinerarybody-otp-ui--walk-transit-walk-itinerary-with-agency-information&globals=locale:en-US

if we use a screenreader right now the Ride 3 min / 2 stops doesn't announce expanded for screenreader users.

by adding an aria-expanded to the TransitLegSummary I'm now able to hear expanded and collapsed for this line

@nikkisato nikkisato marked this pull request as draft December 16, 2025 22:26
@nikkisato nikkisato marked this pull request as ready for review December 16, 2025 22:26
@nikkisato nikkisato marked this pull request as draft December 16, 2025 22:26
@nikkisato nikkisato marked this pull request as ready for review December 17, 2025 17:26
@nikkisato
Copy link
Author

@miles-grant-ibigroup This is ready for review!

@miles-grant-ibigroup miles-grant-ibigroup self-assigned this Dec 18, 2025
@miles-grant-ibigroup
Copy link
Collaborator

Have you run pnpm update-snapshots?

@nikkisato
Copy link
Author

@miles-grant-ibigroup Ran pnpm update-snapshots

All set now

Copy link
Collaborator

@miles-grant-ibigroup miles-grant-ibigroup left a comment

Choose a reason for hiding this comment

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

Changes look great

Copy link
Contributor

@amy-corson-ibigroup amy-corson-ibigroup left a comment

Choose a reason for hiding this comment

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

Hello! Thank you for the PR and I want to apologize in advance, I think this fix is actually a little more complicated!

Technically we currently announce this button to screenreaders as Ride 3 min / 2 stops (Expand details). I agree with you that aria-expanded is a more appropriate way to handle this (I really hope I'm not forgetting something about why we did it this way!) However if we make this change, it will require the following:

  1. This change should be applied to AccessLegBody, TransitLegSummmary, and TransitLegBody so the accessibility approach is consistent throughout the itinerary.
  2. The InvisibleAdditionalDetails component with "(Expand details)" in each of these components should be removed and the otpUi.TransitLegBody.expandDetails string should also be removed from the internationalization files.
  3. Per the aria-expanded docs, the button in each case will also need an aria-controls property with the id of the collapsed/expanded container.

Let me know if I can clarify any of these points! Thank you again.

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