-
Notifications
You must be signed in to change notification settings - Fork 5
Add missing aria-label attributes to input controls in React webviews #439
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: tnaum-ms <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR addresses a critical accessibility issue (WCAG 4.1.2 - Name, Role, Value) by adding missing aria-label attributes to input controls in React webviews, enabling screen reader users to properly identify the purpose of these controls.
Key Changes:
- Added accessible names to Skip and Limit number inputs using both
aria-labelledbyandaria-labelattributes - Added
aria-labelto AI prompt input, page size dropdown, and view type dropdown - Updated localization bundle with new accessible name strings
- Created comprehensive documentation detailing all accessibility improvements
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| QueryEditor.tsx | Added id attributes to Skip/Limit labels and connected them to inputs via aria-labelledby with aria-label fallback; added aria-label to AI prompt input |
| ToolbarViewNavigation.tsx | Added aria-label to page size dropdown for screen reader identification |
| ViewSwitcher.tsx | Added aria-label to view type dropdown for screen reader identification |
| bundle.l10n.json | Added localized string "Select view type" to localization bundle |
| ACCESSIBILITY_IMPROVEMENTS.md | Comprehensive documentation of all accessibility improvements, affected components, testing performed, and future recommendations |
src/webviews/documentdb/collectionView/components/queryEditor/QueryEditor.tsx
Outdated
Show resolved
Hide resolved
src/webviews/documentdb/collectionView/components/queryEditor/QueryEditor.tsx
Outdated
Show resolved
Hide resolved
ACCESSIBILITY_IMPROVEMENTS.md
Outdated
| - Checkboxes have associated labels via the label prop | ||
|
|
||
| ### Best Practices Applied | ||
| 1. **Dual Labeling Strategy**: Used both `aria-labelledby` (to reference visible labels) and `aria-label` (as fallback) for number inputs |
Copilot
AI
Jan 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The documentation incorrectly describes using both aria-labelledby and aria-label as a "Dual Labeling Strategy" and suggests aria-label acts as a fallback. This is technically inaccurate - aria-labelledby takes precedence over aria-label when both are present, so the aria-label is ignored, not used as a fallback. The best practice is to use only aria-labelledby when you have a visible label element with an id.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot apply changes based on this feedback, implement this changes for other locations where both aria-labls and labelledby are used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in a183efc. Removed redundant aria-label attributes from Skip and Limit inputs, keeping only aria-labelledby. Updated documentation to reflect proper ARIA implementation - replaced "Dual Labeling Strategy" with "Proper ARIA Labeling" that accurately describes using aria-labelledby for visible labels and aria-label only where no visible label exists.
Co-authored-by: tnaum-ms <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
Accessibility Improvements for React Webviews
Completed Work
Components Fixed
Components Verified (No Changes Needed)
Recent Changes
aria-labelfrom Skip and Limit inputs (aria-labelledby takes precedence per ARIA spec)See ACCESSIBILITY_IMPROVEMENTS.md for detailed summary.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.