Skip to content

Command search inputs and MCP form fields have no accessible name #1327

Open

Description

@danyaberezun

Problem

Screen readers announce several search and form fields without a name.

  • Command pickers (search lists). cmdk 1.1.1 always renders a hidden <label for> that holds the label prop of Command and points the input at it. None of the six pickers passes label: chat/ModelEffortPicker.tsx:505, chat/ModelSelector.tsx:215, panels/BranchPicker.tsx:140, panels/FontPicker.tsx:140, panels/NewWorkspaceDialog.tsx:884, shell/layout/workbenchTabs.tsx:353. The empty label also takes priority over the placeholder, so Chromium computes the combobox name as "". The shared wrapper packages/ui/command.tsx:7-17 doesn't require the prop.
  • MCP server dialogs. Field (panels/McpServerDialogs.tsx:133-157) renders its label as a plain <span> that isn't linked to its control. As a result:
    • text inputs are named only by their placeholder;
    • the raw-entry Textarea at :933 has no name at all;
    • the transport, exposure, tier and scope toggle sets (:316, :380, :732, :741) are read as bare toggle buttons without the field name.

Direction

  • Make label required on @thinkrail/ui/command (on Command or CommandInput) and pass a locale key at each call site.
  • Link MCP Field labels to their controls (<label htmlFor> or aria-labelledby with useId). Name the toggle sets as a group, or switch them to SegmentedControl (see the duplicate-primitives issue).
  • Add unit checks with getByRole("combobox", { name }) so a missing name fails a test.

Found while documenting the component library in #1075.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions