Make unreachable commits list browsable by screenreaders #19341
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes https://github.com/github/accessibility-audits/issues/9547
Description
When a list is not being used for selection purposes, the list should use the role of
list
instead oflistbox
and the items should belistitem
instead ofoption
. This PR adds the ability to change the roles of a list. I checked all our otherList
use cases and they appear to be for selection so I do not believe this needs to be utilized anywhere else.Additionally, a member of our accessibility team who regularly uses screen readers suggested that this lists have a title to be more friendly to screen readers. In the process of adding that, I noticed that we had the ability to provide an
aria-label
to ourList
component but it was on adiv
encapsulating the list not the element with the role oflist
. This means that it would not be announced as the list title, but as a "group" and only if a screen reader decided to read it as it is not semantically expected to have anaria-label
on adiv
element. Hence, there was an a11y linter disable on that line. This pr moves the aria attributes to theGrid
element that has thelist
role and removes the linter disable. Bonus win!Additionally again.. when I started this work, it was glaring that there had been a regression in the alignment of the unreachable commit link in the commit header. I went ahead and addressed that as well.
Screenshots
CleanShot.2024-10-01.at.14.44.44.mp4
Release notes
Notes: [Improved] The commit lists in the "Commit Reachability" dialogs are traversable in browse mode of screen readers.
[Improved] The commit lists now have a title of "Commits" to be more friendly to users of screen readers.
[Fixed] The unreachable commit header link is properly aligned.