Andrew Aquino 964ceed5f3 fix(site): convey selected and current state to screen readers (#32020)
> [!NOTE]
> 🤖 Generated by Coder Agents on behalf of @aqandrew.

Fixes the Deque `state-selected-missing-incorrect` findings (WCAG
4.1.2): screen readers either heard the wrong row as selected, or didn't
hear the selected or current state at all.

**Listboxes.** cmdk sets `aria-selected` on whichever row is highlighted
and ignores the prop. So when focus landed on a picker, the first row
was announced as "selected" and the row with the check mark wasn't. A
small pnpm patch to cmdk 1.1.1 (`site/patches/cmdk@1.1.1.patch`) does
two things:

- An Item's `aria-selected` prop now wins over cmdk's value.
- cmdk now finds the highlighted row by `data-selected`, which still
tracks the highlight, instead of `aria-selected`.

Each picker that shows a check mark now passes its chosen state:
`ComboboxItem` (all `SelectFilter` filters), `Autocomplete`,
`OrganizationAutocomplete`, `ModelSelector`, the Agents org, project,
and workspace pickers, and the org switcher. In `FilterCombobox`, rows
report whether their value is applied (default `false`), its lists are
`aria-multiselectable`, and the flyout's value buttons get
`aria-pressed`. Menus that pass nothing keep cmdk's behavior, where the
highlighted row is selected.

**Workspace page.** The workspace breadcrumb gets `aria-current="page"`.
The Resources and History sidebar buttons, which open and close their
panels, get `aria-pressed`. The selected resource gets `aria-current`.

Closes DEQ-32, Closes DEQ-91, Closes DEQ-162, Closes DEQ-195, Closes
DEQ-221, Closes DEQ-278, Closes DEQ-363, Closes DEQ-395, Closes DEQ-409,
Closes DEQ-559

| Ticket | Surface |
|---|---|
| DEQ-32 | Agents: Attach workspace picker, model selector |
| DEQ-91 | Template builder: Organization picker |
| DEQ-162 | Workspace page: breadcrumb, Resources/History toggles,
resource list |
| DEQ-195 | Workspace sharing: user/group search |
| DEQ-221 | AI Gateway sessions: user and provider filters |
| DEQ-278 | Templates: user filter |
| DEQ-363 | Audit log: resource type, action, user, organization filters
|
| DEQ-395 | Users: status filter |
| DEQ-409 | Create user: Organization picker |
| DEQ-559 | Workspaces: filter menu (`FilterCombobox`) |

There are no visual changes, so there are no screenshots. I ran axe-core
4.11 on the affected open-menu stories on both `main` and this branch.
It reported no new violations; the existing `aria-dialog-name`,
`nested-interactive`, and `aria-required-children` results show up on
`main` too. The listbox dumps match the fix. In
`CompactProjectSelector/Open` on `main`, the highlighted first row is
`aria-selected` and the chosen project isn't. On this branch, only the
chosen project is.

DEQ-572 (template builder stepper) was already fixed on `main` by
#31854, so this PR doesn't touch it.

<details>
<summary>Decisions, dropped review findings, and follow-ups</summary>

**Why a patch.** I looked at two ways to avoid it.

- Rendering the Item `asChild` so the child's `aria-selected` wins broke
keyboard navigation. cmdk finds the highlighted row with
`[aria-selected="true"]`, so Enter and the arrow keys stopped working
once a chosen row stopped matching the highlighted one. The patch moves
that lookup to `data-selected`.
- `aria-checked` on options would leave cmdk's wrong
`aria-selected="true"` on the highlighted row.

Remove the patch once cmdk ships a release that keeps the two states
separate.

**Role choices on the workspace page.**
- Sidebar icon buttons get `aria-pressed`. Clicking the active one
closes its panel, so they are toggles; they don't navigate anywhere.
- Resource rows get `aria-current`. Clicking one selects it and never
deselects it, so it is the current item in a set.

**Self-review.** I ran `frontend-review`, `frontend-deep-review` (all 8
roles), and `frontend-accessibility`, and fixed every blocking and
should-fix finding. One fix: the Create Organization row now has
`aria-selected={false}`, so a highlighted Create Organization row isn't
announced as the selected org.

Dropped findings:
- *Use the input's `aria-activedescendant` instead of `data-selected` to
find the highlight in `FilterCombobox` tests.* I tried it. cmdk leaves
the input's `aria-activedescendant` null in two existing Retry tests
even though a row is highlighted. That's a separate cmdk timing issue,
so the tests keep using `data-selected`, the attribute cmdk documents
for the highlighted item.
- *Only mark `FilterCombobox` lists `aria-multiselectable` when they
hold value rows (nit).* I left it on the shared list: every list in this
component can apply several values at once.

Follow-ups, out of scope here:
- Inline-search `Autocomplete`, used only by `ModelIdentifierField`,
sets `aria-activedescendant` and `aria-controls` to ids that cmdk
overwrites, so the highlight was never announced there. This predates
the PR.
- `MultiSelectCombobox` passes no chosen state, so cmdk still marks its
highlighted row as selected. Its picked options leave the list, and
Deque didn't report it.
- `.claude/docs/FRONTEND_PATTERNS.md` says cmdk overwrites
`aria-selected`. With this patch that's no longer true for Items. That
file is outside `site/`, so it's left for a separate change.

**Checks.** `pnpm test` (whole unit suite), `vitest --project=storybook`
(whole suite; one unrelated loading story failed once and passed on
rerun), `pnpm check`, `pnpm lint`, and `pnpm format`.
</details>
2026-11-19 11:18:45 +01:00
…
…

Coder Logo Light Coder Logo Dark

Self-Hosted Cloud Development Environments and AI Agents

Coder Banner Light Coder Banner Dark

Quickstart | Docs | Why Coder | Premium

discord release godoc OpenSSF Best Practices OpenSSF Scorecard license Ask DeepWiki

Coder is a self-hosted platform for cloud development environments and AI coding agents. Workspaces are defined with Terraform, connected through a secure Wireguard® tunnel, and automatically shut down when not used. Coder Agents runs a native AI coding agent whose loop executes in the control plane on your infrastructure, with no API keys in workspaces.

  • Define cloud development environments in Terraform
    • EC2 VMs, Kubernetes Pods, Docker Containers, etc.
  • Automatically shutdown idle resources to save on costs
  • Onboard developers in seconds instead of days
  • Delegate coding work to AI agents on your infrastructure
    • Bring any model (Anthropic, OpenAI, Google, Bedrock, self-hosted)
    • No LLM credentials in workspaces, user identity on every action
    • Centralized model governance, cost tracking, and audit logging

Coder platform showing templates and a running workspace

Quickstart

Check out our install guides for other methods and a complete tutorial.

Try Coder with the install script on Linux and macOS, or grab the latest binary or installer from GitHub Releases on Windows:

curl -fsSL https://coder.com/install.sh | sh

Start the server and open http://localhost:3000 to create your initial user, create a Docker template, and provision your first workspace:

coder server

For a production deployment, add a PostgreSQL database (version 13 or later) and an external access URL, and see our validated architectures for sizing and infrastructure guidance:

coder server --postgres-url <url> --access-url <url>

Without these flags, Coder uses a built-in database and sets up a *.try.coder.app access URL for evaluation. Use coder --help for the full list of flags and environment variables.

Documentation

Browse the documentation or visit a specific section below:

  • Workspaces: Workspaces contain the IDEs, dependencies, and configuration information needed for software development
  • Templates: Templates are written in Terraform and describe the infrastructure for workspaces
  • Coder Agents: Delegate coding work to AI agents running on your self-hosted infrastructure
  • AI Gateway: Centralize authentication, auditing, and cost controls for AI tooling
  • Administration: Learn how to operate Coder
  • Premium: Learn about paid features built for large teams
  • IDEs: Connect your existing editor to a workspace

Support

Open an issue for bugs and feature requests.

For community support, showcasing what you built, and feedback on in-progress features, join our Discord or GitHub Discussions.

Dedicated support is included in Coder Premium. For more information, visit coder.com/pricing.

Integrations

New integrations are always in progress. Open an issue to request one. Contributions are welcome in any official or community repository.

Official

Community

Contributing

New contributors are always welcome. If you are new to the Coder codebase, see the contribution guide to get started.

Hiring

Apply on the careers page if you are interested in joining the team.

S
Description
No description provided
Readme AGPL-3.0
2.3 GiB
0 Stars 1 Watchers 0 Forks
Languages
Go 73.5%
TypeScript 24.3%
Shell 0.9%
PLpgSQL 0.3%
Go Template 0.2%
Other 0.5%