Skip to content

fix(spotlight): allow mouse click to select select-type arg options - #424

Open
Samer-Gassouma wants to merge 1 commit into
CoreBunch:mainfrom
Samer-Gassouma:fix/spotlight-select-arg-click
Open

fix(spotlight): allow mouse click to select select-type arg options#424
Samer-Gassouma wants to merge 1 commit into
CoreBunch:mainfrom
Samer-Gassouma:fix/spotlight-select-arg-click

Conversation

@Samer-Gassouma

@Samer-Gassouma Samer-Gassouma commented Aug 23, 2026

Copy link
Copy Markdown

While collecting args for a command with a select arg (like the template plugin's "Greet user…" tone step), the option rows only reacted to hover, not clicks. The selection logic lived only in the Enter handler, so clicking an option did nothing — you had to type and press Enter.

Summary

  • Pulled the arg-selection step into a selectArg(value) helper in Spotlight.tsx.
  • Threaded it through SpotlightResultsArgModeResults via a new onSelectArg prop.
  • Each select-option row now fires onSelectArg(opt.value) on click, mirroring Enter (advance to the next arg, or run the command on the last arg).
  • Added a regression test in SpotlightResults.test.tsx that clicks an option and asserts the correct value is selected.

Verification

  • bun test ./src/admin/spotlight → 85 pass (incl. the new test)
  • tsc -b → clean
  • Note: bun run build (vite) currently fails in my sandbox due to an unrelated lru-cache / @babel/helper-compilation-targets dependency conflict — not introduced by this change.

Fixes #420

The Command Spotlight rendered select-type argument options as rows with
onMouseEnter only, so the selection logic (which lived solely in the Enter
key handler) was unreachable from a click. Clicking an option did nothing.

Extract the arg-selection step into a selectArg(value) callback in
Spotlight.tsx and thread it through to SpotlightResults → ArgModeResults via a
new onSelectArg prop. Each option row now fires onSelectArg(opt.value) on
click, mirroring the existing Enter behavior (advance to next arg or run the
command on the last arg).

Adds a regression test in SpotlightResults.test.tsx.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant