Skip to content

fix: make the side nav's user menu reachable from the keyboard - #3851

Draft
kaustubhdgr8 wants to merge 1 commit into
ClickHouse:mainfrom
kaustubhdgr8:fix/user-menu-keyboard
Draft

kaustubhdgr8 wants to merge 1 commit into
ClickHouse:mainfrom
kaustubhdgr8:fix/user-menu-keyboard

Conversation

@kaustubhdgr8

Copy link
Copy Markdown
Contributor

Summary

The user menu at the bottom of the side nav (avatar, name, team) opens User preferences, Team settings and Log out. Its Menu.Target was a Mantine Paper, which renders a <div>: it has no tabindex, 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.

  • The trigger renders Paper as a <button type="button"> (component="button"), so it is focusable and opens with Enter and Space through Mantine's Menu.
  • .userMenu gets 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-visible uses the same highlight as hover, as the nav links do.
  • Collapsed to the avatar, the button holds the user's name in VisuallyHidden, so it is named "Jane Doe" rather than only "JD". Expanded, its visible text already names it.
  • New AppNavUserMenu.test.tsx: in both nav states, Tab focuses the trigger and Enter opens the menu ("User preferences" appears). Both fail on main ("Unable to find an accessible element with the role "button" and name /Jane Doe/").
  • Changeset: @hyperdx/app patch.

Screenshots or video

No visual change. Screenshots of the full nav (1280x720, yarn app:dev:local, dev overlays hidden) on main and 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).

Before (main) After (this branch)
<div>, tabIndex -1, not in the accessibility tree as a control <button>, tabIndex 0, button named "U Local mode" (local mode)
Enter / Space: nothing Enter / Space: menu opens

How to reproduce

Starting point: yarn app:dev:local + Connect to Demo Server.

On main:

  1. Click into the page, then press Tab repeatedly. Focus never lands on the user menu at the bottom of the side nav.
  2. In DevTools, the element with data-testid="user-menu-trigger" is a <div> with no tabindex.

On this branch:

  1. Tab reaches the user menu after the nav items; it shows the same highlight as on hover.
  2. Enter or Space opens the menu; arrow keys move through its items as before.
  3. Collapse the nav: the avatar button is still reachable and is named with the user's name.

How to test on Vercel preview

Preview routes: /search

Steps:

  1. Verify the element with data-testid "user-menu-trigger" is a button.
  2. Focus it with the keyboard and press Enter; verify the element with data-testid "user-preferences-menu-item" is visible.

References

@vercel

vercel Bot commented Nov 27, 2026

Copy link
Copy Markdown

@kaustubhdgr8 is attempting to deploy a commit to the HyperDX Team on Vercel.

A member of the Team first needs to authorize it.

@changeset-bot

changeset-bot Bot commented Nov 27, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 8953cdd

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@hyperdx/app Patch
@hyperdx/api Patch
@hyperdx/otel-collector Patch

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

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant