Skip to content

fix(site/src/modules/workspaces/WorkspaceSharingForm): include visible text in sharing control names - #32137

Merged
aqandrew merged 3 commits into
mainfrom
a11y/speech-accessible-name-missing
Nov 13, 2026
Merged

aqandrew merged 3 commits into
mainfrom
a11y/speech-accessible-name-missing

Conversation

@aqandrew

@aqandrew aqandrew commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

Two workspace sharing controls had accessible names that did not contain their visible text, so speech input users could not activate them by saying what they see (WCAG 2.5.3, Label in Name).

  • Role selects show "Use" or "Admin", but were named only "Role for " or "Role". The names now end with the selected role, for example "Role for alice: Use" and "Role: Use".
  • The "Search for user or group" trigger shows only the selection once something is picked, so its name became just "Platform Engineering". A hidden label now comes before the selection in the name: "Search for user or group Platform Engineering". Callers that pass their own triggerAriaLabelledBy (ProjectAccessDialog) keep it.

Closes DEQ-266
Closes DEQ-603

Ticket UI surface
DEQ-266 Workspace sharing dialog and settings page: role select in the add member row and in each member and group row
DEQ-603 Agents chat Share flyout, plus the workspace sharing dialog and settings page: "Search for user or group" trigger after a selection

No screenshots: only accessible names change, so nothing looks different.

Already fixed on main by #31873, so this PR does not touch them: DEQ-204 (AI Bridge client and model filter search), DEQ-336 (Find organization search), DEQ-606 (Agents "Search workspaces..." picker), and element 2 of DEQ-266 (the "Search for user or group" search input).

Grouping and decision log
  • Label speech-accessible-name-missing has 5 agent-ok tickets: DEQ-204, DEQ-266, DEQ-336, DEQ-603, DEQ-606. DEQ-603 and DEQ-606 have no project set and were added on request.
  • DEQ-204, DEQ-336 and DEQ-606 are cmdk search inputs. fix(site/src): give cmdk search inputs an accessible name #31873 set the cmdk label on every Command with a search input. In Storybook on main, the inputs are named "Search client", "Search model", "Find organization" and "Search workspaces". No change needed.
  • DEQ-266: fix: give buttons accessible names #30796 added aria-label="Role for <name>" after the audit, which replaced the visible value in the name. The fix appends the selected role to that label.
  • DEQ-603: fixed in the shared modules/workspaces/WorkspaceSharingForm/UserOrGroupAutocomplete, which renders the trigger on the Agents Share flyout and in workspace sharing. It reuses the existing ProjectAccessDialog pattern (aria-labelledby="<label> <trigger>"). The labelledby applies only while a value is selected. With no selection the placeholder is already the visible text and the name, so it is not repeated. The label is hidden instead of sr-only, so screen readers do not read it as stray text in browse mode. aria-labelledby still uses it.
  • The fallback trigger id is now useId() instead of the literal workspace-user-or-group-autocomplete, because aria-labelledby now references it and FE6 requires generated ids. Nothing in site/src or site/e2e referenced the literal.
  • Self-review: frontend-review, frontend-deep-review, and frontend-accessibility pass. In Storybook (pages/AgentsPage/ChatSharingPopover/EmptyACL), after picking "developer" the trigger is named "Search for user or group developer", and axe-core 4.11.1 reports no WCAG violations.
  • Out of scope, no tickets: ProjectRoleSelect in ProjectAccessDialog has the same role select pattern as DEQ-266. TemplatePermissionsPage/UserOrGroupAutocomplete and ACLPrincipalAutocomplete lose their label after a selection, like DEQ-603.

🤖 Generated by Coder Agents on behalf of @aqandrew.

…lected role in role select names

The workspace sharing role selects show "Use" or "Admin", but their
accessible names were only "Role for <member>" and "Role". Speech input
users who say the visible text could not activate them (WCAG 2.5.3).
The names now end with the selected role, for example
"Role for alice: Use".
@aqandrew
aqandrew temporarily deployed to main November 12, 2026 22:18 — with GitHub Actions Inactive
@aqandrew
aqandrew temporarily deployed to main November 12, 2026 22:18 — with GitHub Actions Inactive
@linear-code

linear-code Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

DEQ-266

DEQ-603

@aqandrew
aqandrew marked this pull request as ready for review November 12, 2026 22:29
@aqandrew
aqandrew temporarily deployed to main November 12, 2026 22:29 — with GitHub Actions Inactive
…or group label after a selection

Once a user or group is selected, the trigger shows only the selection,
so its accessible name lost "Search for user or group" (WCAG 2.5.3).
A hidden label now precedes the selection in the name, for example
"Search for user or group Platform Engineering". Callers that pass
their own triggerAriaLabelledBy keep it.
@aqandrew
aqandrew temporarily deployed to main November 13, 2026 17:34 — with GitHub Actions Inactive
@aqandrew aqandrew changed the title fix(site/src/modules/workspaces/WorkspaceSharingForm): include the selected role in role select names fix(site/src/modules/workspaces/WorkspaceSharingForm): include visible text in sharing control names Nov 13, 2026
@aqandrew
aqandrew temporarily deployed to main November 13, 2026 17:34 — with GitHub Actions Inactive
triggerRef={triggerRef}
/>
<>
<span id={labelId} hidden>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

is hidden the idiomatic approach here? I know elsewhere we use the sr-only class, but if there's precedent please ignore this!

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

sr-only would make screen readers read the label twice, so hidden is intentional here. aria-labelledby still includes content it points to directly, even when that content is hidden (I checked the name in Chromium: "Search for user or group developer"). An sr-only span stays in the accessibility tree, though, so a screen reader reading through the page would hear "Search for user or group" as plain text and then again in the button's name. With no selection the span isn't referenced at all, so sr-only would just leave a stray copy of the placeholder next to the button.

ChatDragAnnouncer.tsx is the only other place that uses hidden for this. If we want to standardize on sr-only (or on hidden), that would be a separate PR, since this one is scoped to WorkspaceSharingForm.

🤖 Generated by Coder Agents on behalf of @aqandrew.

@aqandrew
aqandrew temporarily deployed to main November 13, 2026 20:51 — with GitHub Actions Inactive
@aqandrew
aqandrew merged commit 2639ce4 into main Nov 13, 2026
27 checks passed
@aqandrew
aqandrew deleted the a11y/speech-accessible-name-missing branch November 13, 2026 21:05
@aqandrew
aqandrew temporarily deployed to docs-preview November 13, 2026 21:05 — with GitHub Actions Inactive
@aqandrew
aqandrew temporarily deployed to main November 13, 2026 21:05 — with GitHub Actions Inactive
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 13, 2026

This branch was previously deployed

2 inactive deployments
docs-preview — accea120 Deployed Nov 13, 2026 by aqandrew via cleanup #58
main — accea120 Deployed Nov 13, 2026 by aqandrew via cla #257012
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