Skip to content

fix(site/src/modules/dashboard/Navbar/UserDropdown): hide the AI spend bar from the profile menu's accessibility tree - #32023

Merged
jeremyruppel merged 1 commit into
mainfrom
a11y/aria-required-children
Nov 12, 2026
Merged

jeremyruppel merged 1 commit into
mainfrom
a11y/aria-required-children

Conversation

@bartekgatzcoder

Copy link
Copy Markdown
Collaborator

The profile menu (role="menu") rendered the AI spend UsageBar (role="progressbar") as a direct child. A menu cannot own a progressbar, so axe reports aria-required-children on the menu. The bar now sits inside an aria-hidden wrapper. The spend, limit, and period are still exposed as text, and the avatar trigger's accessible name already carries the warning and exceeded state.

There is no visual change: before and after screenshots of UserDropdown/WithAISpend with the menu open are byte-identical, so no screenshots are attached. The existing AI spend stories now query the progressbar with hidden: true.

Closes DEQ-307

Ticket UI surface
DEQ-307 Navbar, profile menu: AI spend summary (shown when the user has an AI spend limit)
Grouping and decision log
  • Batch aria-required-children has two eligible tickets, with two root causes.
  • Rejected: wrapping the block in DropdownMenuGroup (role="group"). axe 4.11 looks through groups inside a menu, and the progressbar stayed flagged.
  • Rejected: turning the block into a DropdownMenuItem, normal or disabled. That would present it as a command with no action, or as an unavailable one that Radix skips, and it changes hover and focus styling.
  • Not done: moving the spend summary outside role="menu". That is cleaner for a rich account panel but is a structural change beyond this fix. Tradeoff: the spend text is in the accessibility tree but not reachable with menu arrow keys. That is unchanged from main.
  • Verification with axe-core 4.11.1 on the UserDropdown stories with the menu open:
    • main: 1 aria-required-children violation in each story that renders the bar (WithAISpend, AISpendWarning, AISpendExceeded).
    • This branch: 0 across WithAISpend, AISpendWarning, AISpendAtLimit, AISpendExceeded, AISpendZeroSpend, AISpendZeroLimit, AISpendUnlimited, and UserDropdown.
    • The full rule set shows no other difference. The remaining page-level results (landmark-one-main, page-has-heading-one, region) are story-isolation artifacts.
  • No new test. Vitest has no axe tooling, and FE1 rules out asserting attribute presence. axe was run by hand, as above.
  • Self-review: frontend-review found nothing. frontend-deep-review raised CD4 (the comment overstated the ARIA rule) and it is fixed; the other finding was an RO3 nit, below. frontend-accessibility found nothing blocking.
  • Dropped findings:
    • RO3 nit (lift the repeated progressbar lookup into a helper): the duplication predates this PR, and a helper would grow a one-argument change.
    • FE1 (assertions in the edited play functions): the pattern predates this PR. This PR only changes the query options in them.

🤖 Generated by Coder Agents on behalf of @bartekgatzcoder.

…d bar from the profile menu's accessibility tree

The profile menu (role=menu) rendered the AI spend UsageBar (role=progressbar) as a direct child, which axe reports as aria-required-children. The spend, limit, and period are already exposed as text, so the bar is now aria-hidden.
@bartekgatzcoder
bartekgatzcoder temporarily deployed to main November 10, 2026 22:44 — with GitHub Actions Inactive
@bartekgatzcoder
bartekgatzcoder temporarily deployed to main November 10, 2026 22:44 — with GitHub Actions Inactive
@linear-code

linear-code Bot commented Nov 10, 2026

Copy link
Copy Markdown

DEQ-307

@bartekgatzcoder
bartekgatzcoder marked this pull request as ready for review November 10, 2026 22:54
@bartekgatzcoder
bartekgatzcoder temporarily deployed to main November 10, 2026 22:54 — with GitHub Actions Inactive
@jeremyruppel
jeremyruppel merged commit 9ed1f0a into main Nov 12, 2026
54 of 55 checks passed
@jeremyruppel
jeremyruppel temporarily deployed to main November 12, 2026 22:32 — with GitHub Actions Inactive
@jeremyruppel
jeremyruppel temporarily deployed to docs-preview November 12, 2026 22:32 — with GitHub Actions Inactive
@jeremyruppel
jeremyruppel deleted the a11y/aria-required-children branch November 12, 2026 22:32
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 12, 2026

This branch was previously deployed

2 inactive deployments
docs-preview — 2a9aa55f Deployed Nov 12, 2026 by jeremyruppel via cleanup #15
main — 2a9aa55f Deployed Nov 12, 2026 by jeremyruppel via cla #255367
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants