fix: comprehensive accessibility improvements for Mermaid toolbar icon buttons#488
Open
aradhyacp wants to merge 11 commits intovercel:mainfrom
Open
fix: comprehensive accessibility improvements for Mermaid toolbar icon buttons#488aradhyacp wants to merge 11 commits intovercel:mainfrom
aradhyacp wants to merge 11 commits intovercel:mainfrom
Conversation
…en toggle buttons
…hidden from accessibility tree
Contributor
|
@aradhyacp is attempting to deploy a commit to the Vercel Team on Vercel. A member of the Team first needs to authorize it. |
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.
Description
This PR provides a comprehensive fix for accessibility warnings in Mermaid toolbar components where decorative SVG icons were exposed to the accessibility tree without proper labeling, triggering WCAG violations.
Building upon the valuable work in #486 and #487, this PR extends the fix to cover all Mermaid-related icon buttons consistently, including edge cases that were previously missed.
Type of Change
Related Issues
Fixes #485
Changes Made
Components Updated:
mermaid/download-button.tsx- Addedaria-labelto all buttons andaria-hidden="true"to DownloadIconmermaid/fullscreen-button.tsx- Addedaria-labelto trigger and close buttons,aria-hidden="true"to iconsmermaid/pan-zoom.tsx- Addedaria-labelto all zoom control buttons,aria-hidden="true"to all icons, integrated translation contextcode-block/copy-button.tsx- Addedaria-labelandaria-hidden="true"to icon (used in Mermaid toolbar viacomponents.tsx)Translation Support:
translations-context.tsx- AddedzoomIn,zoomOut, andresetViewtranslation keys with default English valuesKey Improvements:
aria-hidden="true"to hide them from accessibility treearia-labelattributes for screen reader usersTesting
Test Coverage
Screenshots/Demos
Checklist
pnpm changeset)Changeset
Additional Notes
Why this PR is comprehensive:
This PR ensures complete coverage by:
components.tsxline 912)zoomIn,zoomOut,resetView) to maintain consistency with other toolbar buttonsaria-labelon buttons,aria-hidden="true"on decorative iconsAcknowledgments:
Thank you to the contributors of #486 and #487 for identifying this issue and starting the fix. This PR builds on that foundation to provide a complete solution :)