fix(spotlight): allow mouse click to select select-type arg options - #424
Open
Samer-Gassouma wants to merge 1 commit into
Open
fix(spotlight): allow mouse click to select select-type arg options#424Samer-Gassouma wants to merge 1 commit into
Samer-Gassouma wants to merge 1 commit into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
While collecting args for a command with a
selectarg (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
selectArg(value)helper inSpotlight.tsx.SpotlightResults→ArgModeResultsvia a newonSelectArgprop.onSelectArg(opt.value)on click, mirroring Enter (advance to the next arg, or run the command on the last arg).SpotlightResults.test.tsxthat clicks an option and asserts the correct value is selected.Verification
bun test ./src/admin/spotlight→ 85 pass (incl. the new test)tsc -b→ cleanbun run build(vite) currently fails in my sandbox due to an unrelatedlru-cache/@babel/helper-compilation-targetsdependency conflict — not introduced by this change.Fixes #420