NIN-11 | Improve accessibility for Modal and Button components#11
Merged
NIN-11 | Improve accessibility for Modal and Button components#11
Conversation
Added aria-labels to Button and Modal components to enhance accessibility. Updated test cases and modal titles for clarity. Improved AuthorContent links and icons with appropriate aria attributes.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Overview
This branch focused on enhancing accessibility across the application by adding comprehensive ARIA labels to interactive elements, particularly in the Modal component and related UI components. These improvements ensure better screen reader support and overall accessibility compliance.
Changes Made
1. Button Component Enhancement (
app/components/ui/Button.tsx)aria-labelprop supportaria-labelprop to any Button component for enhanced accessibility2. Modal Footer Button (
app/components/ui/Modal/index.tsx)aria-labelcombiningfooterButtonTextandtitle"${footerButtonText} ${title}"3. Welcome Modal ARIA Label (
app/components/ControllerPlayground/index.tsx)ariaLabelinstead ofundefined"Welcome to Nintroller"4. AuthorContent Component (
app/components/ui/Modal/content/AuthorContent.tsx)"Visit daviddomingo.dev - David Domingo's website""View @avicrayyy on GitHub""Visit daviddomingo.dev"aria-hidden="true"to decorative icons:GitHubIconandGlobeIconare now hidden from screen readersFiles Changed
Testing Updates
Modal Tests
aria-labelformat"Confirm Test Modal"instead of just"Confirm"Test Coverage
Accessibility Improvements
Screen Reader Support
ARIA Best Practices
aria-hidden="true"aria-labelattributesImpact
Benefits
No Breaking Changes
Related Components
app/components/ui/Button.tsx- Base button component with ARIA supportapp/components/ui/Modal/index.tsx- Modal component with enhanced labelsapp/components/ui/Modal/content/AuthorContent.tsx- Author information modalapp/components/ControllerPlayground/index.tsx- Main playground orchestratorNotes for Maintainers
When Adding New Buttons
aria-labelis optionalaria-labelWhen Adding New Links
aria-labelattributes"Action destination"(e.g.,"Visit example.com")aria-hidden="true"Modal Footer Buttons
aria-labelcombining text and title"${footerButtonText} ${title}"Testing ARIA Labels
getByRolewithnameoption to test ARIA labelsscreen.getByRole("button", { name: "Confirm Test Modal" })Future Considerations
aria-describedbyfor additional context when neededaria-labelledbyfor complex modal structuresaria-liveregions for dynamic content updates (already implemented for cheat unlocks)Accessibility Checklist