Skip to content

[Bug]: Select-type command args can't be chosen by mouse click in Command Spotlight #420

Description

@squarestar

Summary

Select-type command args can't be chosen by mouse click in Command Spotlight.

Component: src/admin/spotlight/SpotlightResults.tsx, function ArgModeResults (lines 150–168). Feature is unusable via mouse; keyboard-only workaround exists but isn't discoverable.

In SpotlightResults.tsx, each option row wires onMouseEnter (updates highlight only) but has no onClick:

// SpotlightResults.tsx:150-168
{filteredOptions.map((opt, idx) => (
  <div
    key={opt.value}
    className={...}
    role="option"
    aria-selected={idx === highlightedIndex}
    onMouseEnter={() => onHighlightChange(idx)}
    // no onClick — nothing submits the selection
  >

The actual selection logic lives entirely in the Enter key handler in Spotlight.tsx (lines 166–192): it reads highlightedIndex, resolves the option value, and either dispatches SAVE_ARG_AND_ADVANCE or calls runCommandWithArgs if it's the last arg. That logic is not reachable from a click — ArgModeResults isn't given any callback capable of triggering it, only onHighlightChange.

Steps to reproduce

  • Install/activate a plugin registering a palette command with a select-type arg (e.g. examples/plugins/template → "Greet user…", the tone arg).
  • Open Command Spotlight (Ctrl+K / ⌘K), run the command, fill the first (text) arg.
  • On the select arg step, a dropdown-style list of options renders.
  • Click an option.

Expected behavior

Clicking an option selects it and advances to the next arg (or runs the command if it's the last arg) — mirroring what Enter already does.

Actual behavior

Nothing happens. The row only highlights on hover; clicking has no effect. The only way to actually choose an option is to type text to filter, then press Enter (which reads highlightedIndex from keyboard navigation state).

Version or commit

No response

Deployment mode

None

Logs or screenshots

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