Fix: Accessible name mismatch for AI Chat button#3934
Open
huangkevin-apr wants to merge 3 commits intoGitbookIO:mainfrom
Open
Fix: Accessible name mismatch for AI Chat button#3934huangkevin-apr wants to merge 3 commits intoGitbookIO:mainfrom
huangkevin-apr wants to merge 3 commits intoGitbookIO:mainfrom
Conversation
🦋 Changeset detectedLatest commit: bc80ccb The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
SamyPesse
reviewed
Jan 29, 2026
Member
SamyPesse
left a comment
There was a problem hiding this comment.
Thank you! please update the branch with main where we made changes to the CI to trigger preview deployments. And also add a changeset by running bun run changeset
| iconOnly={!showLabel || isMobile} | ||
| size="medium" | ||
| variant="header" | ||
| aria-label={t(language, 'ai_chat_ask', assistant.label)} |
Member
There was a problem hiding this comment.
You have to use tString here, otherwise it returns a ReactNode
Author
There was a problem hiding this comment.
Thanks for your feedback, I have updated these details.
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.
Summary
This PR fixes an accessibility violation on website doc page where the accessible name of the AI Chat button did not match its visible label, as reported by the IBM Equal Access Accessibility Checker.
The issue occurred because the button’s accessible name was implicitly derived from a non-string label prop (a JSX node), which resulted in an incorrect or opaque accessible name (e.g.
[object Object]). This caused screen readers and a11y tools to report a mismatch between the visible label and the accessible name.Solution
Explicitly set a string-based accessible name using the
aria-labelprop.Keep the existing
labelprop for tooltip / visual rendering only.<Button iconOnly={!showLabel || isMobile} size="medium" variant="header" label={ + aria-label={t(language, 'ai_chat_ask', assistant.label)} // Explicit accessible name string <div className="flex items-center gap-2"> {t(language, 'ai_chat_ask', assistant.label)} {withShortcut ? (This ensures:
Testing
The patch submitted in this PR was generated by A11YRepair, an automated Web Accessibility repair tool that I developed to address common accessibility violations in web applications. The generated fixes were manually reviewed and validated before submission.
The fix has been manually verified in the following locales:
✅ English



✅ Chinese
✅ French