Skip to content

fix: give buttons accessible names - #30796

Merged
aqandrew merged 3 commits into
mainfrom
fix/a11y-button-names
Oct 14, 2026
Merged

aqandrew merged 3 commits into
mainfrom
fix/a11y-button-names

Conversation

@aqandrew

@aqandrew aqandrew commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes the axe button-name (WCAG 4.1.2) findings from the Deque audit:

  • fixes DEQ-431
  • fixes DEQ-456
  • fixes DEQ-101 (duplicate of DEQ-456)
  • fixes DEQ-138

affected buttons:

  • Workspace sharing role selects (DEQ-431, DEQ-456, DEQ-101): Radix Select triggers render role="combobox", and ARIA doesn't let a combobox take its name from its content. That's why the visible "Use"/"Admin" text didn't count. Each member row's select is now named Role for <member>. The add-member form's select is named Role.
  • Agent logs "Copy selected logs" button (DEQ-138): the icon-only button had a name only in its tooltip. It now has sr-only text, matching the download button next to it.

Adds Vitest coverage in WorkspaceSharingForm.test.tsx. The test finds each select by its accessible name and checks that changing the role calls the update callback. It fails without the fix.

Implementation notes and review decisions

Mapping axe selectors to components

  • DEQ-431: form > div > button:nth-child(2) is RoleSelectField in AddWorkspaceUserOrGroup.
  • DEQ-456 / DEQ-101: table > tbody > tr > td:nth-child(2) > button is RoleSelect in WorkspaceSharingForm.
  • DEQ-138: section:nth-child(3) (agent card logs section) > … > div:nth-child(2) > button:nth-child(1) is the copy button in the AgentRow logs toolbar. data-state="closed" with no aria-expanded means it's a Tooltip trigger.

Justified findings from the frontend review (frontend-deep-review and frontend-review)

  • FE1/TS5, no Vitest for the copy button: rendering AgentRow with streamed logs needs the proxy context and websocket log fixtures. The change only adds an sr-only label. I removed a story play assertion that I'd first added, because FE1 bans assertions in play functions.
  • FE6, label-in-name (WCAG 2.5.3): the combobox's visible text is its value ("Use"/"Admin"), not its label. The visible label is the "Role" column header, and the accessible names include it. Screen readers still announce the value from the trigger's content.
  • Not changed: the copy button's tooltip switches to "Copied!" but screen readers hear no announcement. That was already the case before this PR, and it's a different WCAG criterion (4.1.3), so it's out of scope here.

Checks run: pnpm check, pnpm lint:types, pnpm lint, the unit tests, the AgentRow / WorkspaceSharingPage / WorkspaceActions story tests, and make pre-commit.


Generated by Coder Agents on behalf of @aqandrew.

Radix Select triggers render role=combobox, which cannot take its
accessible name from its content, so the workspace sharing role selects
had no name. Label the per-member selects "Role for <member>" and the
add-member select "Role". Give the icon-only copy logs button in the
agent logs toolbar sr-only text.

Fixes DEQ-431, DEQ-456, DEQ-101, DEQ-138.
@linear-code

linear-code Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

DEQ-101

DEQ-431

DEQ-138

DEQ-456

@aqandrew
aqandrew marked this pull request as ready for review October 14, 2026 22:43

@Jesswinters Jesswinters left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some nice lil improvements for buttons! And yay for a test too ✨

@aqandrew
aqandrew merged commit 1d57682 into main Oct 14, 2026
33 checks passed
@aqandrew
aqandrew deleted the fix/a11y-button-names branch October 14, 2026 22:58
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 14, 2026
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