In inline search mode, `Autocomplete` points the input's `aria-controls`
and `aria-activedescendant` at ids it passes to `CommandList` and
`CommandItem`. cmdk writes its own generated `id` after spreading props,
so neither id ever rendered. Screen readers announced nothing as the
user arrowed through suggestions (AI settings > Models > Add model,
model identifier field).
The repository already patches cmdk 1.1.1 so an Item's `aria-selected`
prop wins. This extends that patch so an `id` prop on `Command.List` and
`Command.Item` replaces cmdk's generated id. An Item uses that id
internally too, so cmdk's highlight recovery and score sort keep
working. `Autocomplete` now derives each option id from the option value
rather than its index, because cmdk requires an Item id to stay the same
while the item is mounted.
`ModelSelector` was the only other caller passing an `id` to
`CommandList`. cmdk used to drop it, so the trigger's `aria-controls`
pointed nowhere. With the patch, that id would also break
`CommandInput`'s own `aria-controls`. The trigger now points at its
popover instead, the same as `OrganizationAutocomplete`, and no longer
overrides Radix's `aria-haspopup="dialog"` with `"listbox"`, so the
announced popup type matches the popup.
Closes DEQ-627
| Ticket | UI surface |
|---|---|
| DEQ-627 | AI settings > Models > Add model, model identifier
suggestions (and any `inlineSearch` `Autocomplete`); `ModelSelector`
trigger `aria-controls` |
No screenshots: the change only fixes ARIA id references, so nothing
changes visually.
Verification:
- **Unit tests:** the new `Autocomplete` tests fail without the patch
and pass with it. One checks that `aria-controls` and
`aria-activedescendant` resolve to the listbox and the highlighted
option. The other is an `it.each` that keeps a highlighted match after
typing filters options out; it caught a regression in an earlier,
index-based version of this fix. A new `ModelSelector` test checks that
the trigger's `aria-controls` and `aria-haspopup` match the opened
popup; it fails on `main`.
- **Storybook axe (`components/Autocomplete` InlineSearch, AI Models add
form):** `aria-valid-attr-value` (critical) fails on `main` and passes
on this branch. `scrollable-region-focusable` on the model identifier
listbox is also gone, because the listbox is now owned by the combobox.
- **Checks:** `pnpm check` and `pnpm lint` pass.
Dropped review findings:
- **Drop `ModelSelector`'s own `aria-controls` and let Radix wire it:**
`aria-haspopup="listbox"` is removed as suggested, but the explicit
`aria-controls` and `PopoverContent` id stay. oxlint's
`jsx-a11y/role-has-required-aria-props` requires `aria-controls` on
`role="combobox"` and can't see the one Radix adds at runtime. Our props
override Radix's on both elements, so the reference still resolves
(covered by the new test).
- **`encodeURIComponent` throws on a lone UTF-16 surrogate:** option
values are catalog model ids, so this is not reachable today.
<details>
<summary>Decision log</summary>
- **Root cause:** cmdk 1.1.1 renders `{...props, id: generatedId}` on
both List and Item, so any `id` prop is silently overwritten. FE6
already warns about cmdk overwriting `aria-*` props.
- **Chosen fix: extend the existing pnpm patch.** It is the smallest
change at the source, and the repo already uses this patch for the same
kind of override. Alternatives rejected:
- Reading cmdk's generated ids back from the DOM: needs refs and effects
(FE8) and races cmdk's own rendering.
- Rendering a separate listbox outside cmdk: duplicates the primitive
(FE3).
- **Item id is also cmdk's internal id:** the first version only
replaced the DOM id. A reviewer traced that cmdk's unmount cleanup
compares the DOM id with its registration id, so filtering out the
highlighted option left nothing highlighted and Enter did nothing. The
patch now feeds the prop into cmdk's own `useId` slot.
- **Value-based option ids:** index-based ids changed when an earlier
option was filtered out while the option stayed mounted. cmdk registers
an item only once, so its bookkeeping went stale ("No results found"
next to a live option, lost highlight). The ids now come from
`encodeURIComponent(optionValue)`; values are already unique React keys.
- **List id override:** a List with its own id no longer matches
`Command.Input`'s `aria-controls`. The patch header says to give a List
an id only when it has no `Command.Input`. `ModelSelector` was the only
caller doing both, and it was updated. Per review, the `CommandList` and
`CommandItem` wrappers in `Command.tsx` now document these caller rules
too.
- **Size:** about 30 non-test lines plus the regenerated patch and
lockfile hash.
</details>
🤖 Generated by Coder Agents on behalf of @bartekgatzcoder.
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
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
- Coder Registry: Templates, modules, and integrations for common development environments
- Coding Agents: Run agents like Claude Code, Codex, and OpenCode isolated in Coder workspaces
- coderd Terraform Provider: Declaratively manage your Coder deployment configuration as code
- VS Code Extension: Open any Coder workspace in VS Code with a single click
- JetBrains Toolbox Plugin: Open any Coder workspace from JetBrains Toolbox with a single click
- Dev Containers: Build development environments using
devcontainer.jsonon Docker, Kubernetes, and OpenShift - Kubernetes Log Stream: Stream Kubernetes Pod events to the Coder startup logs
- Self-Hosted VS Code Extension Marketplace: A private extension marketplace that works in restricted or airgapped networks integrating with code-server.
- GitHub Actions: An action to set up the Coder CLI in GitHub workflows
Community
- Coder Discord: Chat with the community, get support, and hear about new product updates first
- Community Templates: Community-contributed workspace templates in the Coder Registry
- Community Modules: Community-contributed modules to extend Coder templates
- Coder Template GitHub Action: A GitHub Action that updates Coder templates
- Coder Agents Chat Action: A GitHub Action that starts a Coder Agents chat against a GitHub issue or pull request
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.
