fix(web): expose selection state to assistive technology - #30
Merged
Conversation
The format segmented control, queue filter tabs, and queue items communicated their active/selected state visually only — screen readers heard identical buttons. The segmented control now lives in a fieldset/legend group with aria-pressed on each segment, the filter tabs carry aria-pressed, and the selected queue item carries aria-current, matching each control's semantics (toggle vs current item in a set). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Contributor
|
React Doctor found no new issues. 🎉 Reviewed by React Doctor for commit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
The interface review of the merged motion stack flagged (pre-existing, MEDIUM) that every selection state in the app was visual only: the format segmented control, the queue filter tabs, and the queue items all announced themselves to screen readers as identical, stateless buttons.
Root Cause
No control carried a programmatic state attribute — active/selected was expressed purely through Tailwind color/background classes.
Solution
Each control gets the semantics that match its behavior, per
better-accessibility("native elements first", "accessible names everywhere"):fieldsetwith alegend("Output Format") — the repo's lint (jsx-a11y/prefer-tag-over-role) correctly pushed this overrole="group"— witharia-pressedon each segment.aria-pressed, since they toggle a filter.aria-current="true", the semantic for the current item in a set.Result
Screen readers now announce toggle and selection state everywhere it exists visually. No visual change; typecheck, lint, 43 tests, and react-doctor 100/100 all pass.
🤖 Generated with Claude Code