Skip to content

fix: render the open-with-AI dropdown as an ARIA menu - #12

Open
EricAndrechek wants to merge 1 commit into
mainfrom
fix/menu-roles
Open

EricAndrechek wants to merge 1 commit into
mainfrom
fix/menu-roles

Conversation

@EricAndrechek

Copy link
Copy Markdown
Member

Closes #11

The dropdown was a <details> with a plain <ul> inside <main>, so content passes treated the labels as prose (astro-trademarks put a ™ on "Claude").

  • Trigger is now a <button> with aria-haspopup="menu", aria-expanded, aria-controls.
  • <ul role="menu" aria-labelledby> with <li role="none"> / <a role="menuitem" tabindex="-1">; divider is role="separator".
  • Keys: Enter/Space/ArrowDown open on first item, ArrowUp on last; in the menu arrows wrap, Home/End, type-ahead, Escape closes and refocuses the button, Tab closes. Click outside closes. Logic is in src/lib/menu-keys.ts. Re-inits on astro:page-load.
  • Behaviour change: activating an item now also closes the menu. No data-tm-skip added (roles alone verified sufficient, see below).
  • Tests: pnpm test (node:test, 9 tests), now part of verify and CI.

Verification: ran astro-trademarks transformHtml (registry Claude, contentRoots main, default + Starlight skips) on the markup: roles present -> no mark; roles removed (and hidden removed) -> Claude marked. Keys driven in headless Chromium over CDP against the compiled component script: all pass.

Pre-push reviewer agents (pre-push-reviewer, docs-reviewer) were not run: unavailable from the spawning session.

🤖 Generated with Claude Code

https://claude.ai/code/session_01GgSsyTuDULnYbCwrjB3E51

Replace <details>/<summary> with the WAI-ARIA menu-button pattern: a
button (aria-haspopup/expanded/controls) and a role=menu list of
role=menuitem links with roving tabindex. Arrow, Home/End, type-ahead,
Escape and Tab handling live in a pure, unit-tested helper
(src/lib/menu-keys.ts). Adds node:test unit tests and runs them in CI.

Closes #11

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GgSsyTuDULnYbCwrjB3E51
@coderabbitai

coderabbitai Bot commented Oct 9, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 7cc3db3e-dc16-4d3f-9061-311b30f7ccad

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

fix: mark the Open-with-AI dropdown as UI so content passes don't treat it as prose

1 participant