Repository navigation
fix: make the side nav's user menu reachable from the keyboard - #3851
kaustubhdgr8 wants to merge 2 commits into
Conversation
|
@kaustubhdgr8 is attempting to deploy a commit to the HyperDX Team on Vercel. A member of the Team first needs to authorize it. |
🦋 Changeset detectedLatest commit: 066cb7b The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
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 |
|
Hi @kaustubhdgr8, thanks for the pull request! Before we review code from a first-time contributor, a maintainer vouches for them, and you're not on our list yet. There's nothing else to file and this PR stays open — a maintainer will look at it, usually within a day or two, and vouch for you right here if it's a genuine attempt at the problem. To make that quick, check the PR description has:
More detail in our contributing guide. |
| @@ -133,6 +137,8 @@ export const AppNavUserMenu = ({ | |||
| <Avatar size="sm" radius="xl" color="gray"> | |||
There was a problem hiding this comment.
🟡 P2 — The avatar initials stay in the button's accessible name, so screen readers hear 'JD Jane Doe', or 'U Local mode' in local mode
Add aria-hidden to the <Avatar> so the collapsed button is named just displayName, which is the intent of the new VisuallyHidden. Then make the test assert the exact name ({ name: 'Jane Doe' }) instead of /Jane Doe/, since the regex accepts the duplicated initials.
Advisory. Fix if it is a small defect in code this PR changes; otherwise reply in the thread. Do not widen the PR or touch files it did not already change. How to respond
There was a problem hiding this comment.
Fixed in 066cb7b: the avatar is aria-hidden, and the test now asserts the exact names ('Jane Doe' collapsed, 'Jane Doe Acme' expanded).
PR Review
1 finding(s): 🔴 0 P0/P1 · 🟡 0 P2 · 🔵 1 P3 No inline comments. 1 P3 folded at the bottom. 🔵 1 P3 — no action needed before merge
Priority comes from a separate grading pass over the finished review. P3 is folded here instead of posted inline. No finding blocks merge automatically; a maintainer decides. |
Deep Review✅ No critical issues found. This is a tightly scoped accessibility fix: the side-nav user-menu trigger moves from a 🟡 P2 -- recommended
🔵 P3 nitpicks (2)
Reviewers (6): correctness, testing, maintainability, project-standards, kieran-typescript, previous-comments. Testing gaps:
No finding blocks merge automatically. A maintainer will expect P0/P1 findings in code this PR changes to be fixed; P2/P3 are your call -- fix or reply. Never fix findings about surrounding code here; reply instead. Do not widen the PR. How to respond |
|
Thanks. In 066cb7b:
Focus cue: left as is. It is the same |
Summary
The user menu at the bottom of the side nav (avatar, name, team) opens User preferences, Team settings and Log out. Its
Menu.Targetwas a MantinePaper, which renders a<div>: it has notabindex, so Tab skips it, and Enter and Space do nothing. Keyboard users could not open the menu at all, in either nav state. Screen readers did not expose it as a control either.Paperas a<button type="button">(component="button"), so it is focusable and opens with Enter and Space through Mantine'sMenu..userMenugets the rules a<button>needs to look like the old<div>:display: block, the width the block used to fill, and resets for the browser's border, font, colour and centred text.:focus-visibleuses the same highlight as hover, as the nav links do.VisuallyHidden, so it is named "Jane Doe" rather than only "JD". Expanded, its visible text already names it.AppNavUserMenu.test.tsx: in both nav states, Tab focuses the trigger and Enter opens the menu ("User preferences" appears). Both fail onmain("Unable to find an accessible element with the role "button" and name/Jane Doe/").@hyperdx/apppatch.Screenshots or video
No visual change. Screenshots of the full nav (1280x720,
yarn app:dev:local, dev overlays hidden) onmainand on this branch are pixel-identical in light and dark, expanded and collapsed, apart from the Help icon's twinkling sparkle, which is mid-animation in each shot. The trigger's box is the same (expanded 234x36 at 8,676; collapsed 30x30 at 10,676).main)<div>,tabIndex-1, not in the accessibility tree as a control<button>,tabIndex0, button named "Local mode" (local mode)How to reproduce
Starting point:
yarn app:dev:local+ Connect to Demo Server.On
main:data-testid="user-menu-trigger"is a<div>with notabindex.On this branch:
How to test on Vercel preview
Preview routes: /search
Steps:
References
Note
Low Risk
Localized a11y and styling on the nav user menu trigger with regression tests; no auth, data, or API changes.
Overview
Fixes an accessibility gap in the side nav user menu: the Mantine
Menu.Targetwas aPaperrendering a<div>, so Tab skipped it and Enter/Space did not open User preferences or Log out.The trigger is now
Paperwithcomponent="button"andtype="button", with SCSS resets (display, width, border, font,text-align) and:focus-visiblestyling aligned with hover so appearance stays the same. The avatar getsaria-hidden; when the nav is collapsed,VisuallyHiddensupplies the full display name so the control is not only announced as initials.Adds
AppNavUserMenu.test.tsxcovering Tab focus and Enter/Space opening the menu in expanded and collapsed states, plus a@hyperdx/apppatch changeset.Reviewed by Cursor Bugbot for commit 066cb7b. Bugbot is set up for automated code reviews on this repo. Configure here.