Skip to content

[BUG] [alpha] Critical A11y: Command Palette breaks screen reader navigation (Missing ARIA attributes) #37793

Description

@saurabhp1801

Project

ide

Description

A critical accessibility regression exists in the Command Palette (src/components/palette/CommandPalette.tsx), which completely breaks keyboard navigation for screen reader users.

When users trigger the Command Palette (e.g., Ctrl+Shift+P), focus is placed on the text input. However, the input field lacks essential autocomplete ARIA attributes such as role="combobox", aria-expanded, and most critically, aria-activedescendant. As a user presses the Up/Down arrow keys to navigate the filtered commands, the visual selection changes, but screen readers are given absolutely no indication of which command is currently selected.

Impact: The Command Palette is the primary keyboard interface for the entire IDE. Without proper WAI-ARIA combobox patterns, blind and visually impaired users are completely blocked from effectively utilizing the Command Palette, violating WCAG 4.1.2 (Name, Role, Value).

Screenshots

Image

Steps to Reproduce

  1. Launch Cortex IDE and press Ctrl+Shift+P to open the Command Palette.
  2. Note that focus moves directly into the search <input>.
  3. Use gh or any screen reader inspection tool to view the properties of the <input> element.
  4. Issue: The <input> has only standard attributes (placeholder, type, value), missing the role="combobox".
  5. Press the Down Arrow key to change the selected command.
  6. Issue: Notice the selected <div> receives aria-selected="true", but because the <input> still holds focus without an aria-activedescendant attribute pointing to the selected option's ID, the screen reader does not announce the new selection.

Expected Behavior

The Command Palette must implement the WAI-ARIA Autocomplete pattern:

  1. The <input> should have role="combobox", aria-autocomplete="list", aria-expanded="true", and aria-controls="command-palette-list".
  2. As the user presses Arrow keys, the aria-activedescendant attribute on the <input> must dynamically update to match the id of the currently selected role="option".
  3. Each option must have a unique, deterministic id.

Actual Behavior

The implementation in src/components/palette/CommandPalette.tsx omits aria-activedescendant and unique IDs:

// Current implementation (Lines 209-211) lacks ARIA combobox attributes
<input ref={inputRef} type="text" placeholder={subMode() ? "Filter..." : "Type a command..."} value={query()}
  onInput={e => setQuery(e.currentTarget.value)} onKeyDown={handleKeyDown}
  style={{ ... }} />
  
// Options lack IDs for aria-activedescendant to target (Lines 175-176)
<div data-palette-item style={itemStyle(sel())} role="option" aria-selected={sel()}
  onMouseEnter={() => setSelectedIndex(flatIdx())} onClick={() => handleSelect(cmd.id)}>

Component Location

File: src/components/palette/CommandPalette.tsx

Metadata

Metadata

Assignees

No one assigned

    Labels

    ideIssues related to IDEvalidValid issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions