Repository navigation
Open
Labels
agent-readyContext and acceptance criteria are complete enough for an agent to take this unattended.area: ui-kitThe presentational design kit: components, tokens, Storybook, visual baselines.area: ui-reactReact chat/files/voice components, stores, WebSocket transport.priority: p2Wanted, not scheduled. Pulled in when a milestone has room.type: fixSomething is broken and must behave the way it is documented.
Description
Context
Part of #2576.
Two hand-rolled dropdowns announce themselves as ARIA menus but implement none of the menu keyboard contract. Focus does not move into them, and arrow keys, Home and End do nothing:
- Desktop Attach: (
ComposerView,packages/ui-react/src/components/chat/composer-view.tsx:200-204) renders<div role="menu" aria-label="Attach">. Its children areListRows (composer-view.tsx:133-141), which renderrole="button", notmenuitem. The "Paste" row has no handler and so no role. The kit trigger declaresaria-haspopup="menu"(IconButtoninpackages/ui-kit/src/chrome/Composer.tsx:305), and on a phone that same trigger opens a modal sheet, not a menu. - Share: (
ShareMenu,packages/ui-react/src/components/share/share-menu.tsx:122-142) rendersrole="menu"withrole="menuitem"buttons behind anIconButton haspopup="menu". The diagram share trigger repeats the claim (MermaidBlock,packages/ui-react/src/components/chat/mermaid-block.tsx:108).
composer.tsx:338 also uses [role="menu"][aria-label="Attach"] as its outside-click selector.
Guide ui-atoms/viewport-aware-dropdowns: "Do not apply role="menu" or role="menuitem" unless you fully implement the corresponding keyboard navigation contract … do not add aria-haspopup to the trigger — its value … is a promise that the target exposes a matching role".
Scope
- Make the desktop Attach popover and
ShareMenuplain groups of buttons. Removerole="menu"androle="menuitem". Keep an accessible name on the container (role="group"+aria-label). Keeparia-expandedand addaria-controlson the triggers. - Remove
aria-haspopup="menu"from the Share trigger, the diagram share trigger and the kit Composer's Attach trigger (Composer.tsx:305). The kit cannot tell whether the consumer opens a popover or a sheet, so the Attach trigger carries noaria-haspopup. Do not add a Composer prop for it. - Replace the role-based selector at
composer.tsx:338with adata-hook. - Update the tests and stories that assert the old roles:
packages/ui-react/tests/render/render-smoke.test.tsx:5792,packages/ui-kit/stories/chrome/Composer.stories.tsx:405,packages/ui-react/tests/browser/diagrams-renderer.layout.tsx:66,packages/ui-react/tests/browser/settings-buttons.cases.tsx:136.
Out of scope
SessionOverflow(packages/ui-react/src/components/chat/session-list.tsx:311-352). It moves focus to its single item and closes on Escape and Tab, which is complete for a one-item menu.- Implementing arrow-key menus. Also out: moving these surfaces to
popover(ui-kit: anchored menus and pickers hand-roll dismissal and clip instead of using native popovers #2583). - Kit
IconButton/TextButtonstories that passhaspopup: "menu"as generic prop examples. - Any visual change.
Acceptance criteria
-
grep -rn 'role="menu"\|menuitem\|haspopup="menu"' packages/ui-react/src packages/ui-kit/srcmatches onlysession-list.tsxand the kit primitives' prop type unions. - The desktop Attach and Share popovers expose a named group of buttons. The Share triggers expose
aria-expandedandaria-controls, and no trigger claimsaria-haspopup="menu". - Tab order, Escape, outside-click dismissal and every option's action behave as before in a real browser at 320px and ≥900px.
- A browser accessibility-tree assertion reads the new roles and fails on the current tree. Record the failing-first run in the PR.
- Visual baselines unchanged.
Verification
bun run test packages/ui-react/tests/render/render-smoke.test.tsx
bun run test packages/ui-kit packages/ui-react
node scripts/visual.mjs --project=ui-react-layout --filter=diagrams-renderer
node scripts/visual.mjs --project=storybook --filter=Composer.stories
bun run typecheck
bun run lintContract impact
- This touches the integration contract, so it needs the
contractlabel, aCONTRACT:commit prefix, and the doc updated in the same commit. - This changes a published package's behaviour, so it needs a changeset.
No prop or export changes. Only rendered ARIA attributes change.
Metadata
Metadata
Assignees
Labels
agent-readyContext and acceptance criteria are complete enough for an agent to take this unattended.area: ui-kitThe presentational design kit: components, tokens, Storybook, visual baselines.area: ui-reactReact chat/files/voice components, stores, WebSocket transport.priority: p2Wanted, not scheduled. Pulled in when a milestone has room.type: fixSomething is broken and must behave the way it is documented.
Activity