Repository navigation
Conversation
The signed-in header menu opens only through the group-hover CSS class: the avatar trigger is a plain div, so keyboard users can never focus it, and while the entries are links they stay display:none and outside the accessibility tree until a pointer hover. The sign-out action is a div with a click handler and cannot be activated without a mouse either. Render the avatar as a button with aria-haspopup and open the menu on focus-within in addition to hover, and render the sign-out action as a button so it is focusable and activatable from the keyboard. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: 陈那几 <2078634206@qq.com>
|
@chennaji9 is attempting to deploy a commit to the codersett's projects Team on Vercel. A member of the Team first needs to authorize it. |
This branch has not been deployed
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 signed-in header menu opens only on pointer hover: the avatar trigger is a plain
<div>, so keyboard users can never focus it, and the menu entries (subscribe, my models, personal settings, system admin) staydisplay:none— outside the accessibility tree — until a hover happens. The sign-out action is a<div>with a click handler and cannot be activated without a mouse.Root cause
Menu visibility relies solely on the
group-hover:blockCSS class; neither the trigger nor the sign-out action are focusable/activatable elements.Changes
apps/web/src/common/components/Header/User.tsx:<button type="button">witharia-haspopup="menu"and an accessible label (user name, falling back to the profile-setting string);group-focus-withinin addition togroup-hover, so focusing the trigger (and tabbing through the entries) keeps the menu visible;<button type="button">.Visual appearance is unchanged apart from the focus opening the menu.
Contract impact
Testing
User.test.tsx(auth store, graphql mutation, router and next/image mocked): the trigger is a button named after the user witharia-haspopup="menu"; sign-out is a button; the menu entries are links. The trigger/sign-out role assertions fail against the div-based markup (verified red) and pass with the fix.jest --ci: 116 passed (113 pre-existing + 3 new).tsc --noEmit(apps/web) clean;eslintclean;prettier --checkclean for the changed lines.🤖 Generated with Claude Code