-
Notifications
You must be signed in to change notification settings - Fork 1.7k
fix(cli): auto-select first autocomplete item #4797
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
When the list of autocomplete items is shown for commands or files, the first item is now selected by default. This makes autocomplete quicker to work with and matches how OpenCode works. The fix adds updateAllSuggestionsAtom() which updates all suggestion types atomically and determines which one has items to set the index accordingly. Co-authored-by: marius-kilocode <[email protected]>
🦋 Changeset detectedLatest commit: ac644f2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ No Issues Found4 files reviewed | Confidence: 95% | Recommendation: Merge Review DetailsFiles:
Checked: Security, bugs, performance, error handling, state management Summary:
|
✅ Previous Issues AddressedThe dependency array issue from my previous review has been resolved:
4 files reviewed | Confidence: 95% | Recommendation: Merge Review DetailsFiles:
Checked: Security, bugs, performance, error handling |
|
Hey @marius-kilocode, Quick question about this PR: Since merging, we've noticed an issue where slash commands are being ignored in certain situations when using the The behavior we're seeing:
Could this change be related? I see in the tests that Let me know if you need more details to reproduce this! Thanks! |
|
@Drilmo thanks for flagging. I will check for the root cause. |
Summary
/commands or@file mentionsupdateAllSuggestionsAtom()to update all suggestion types atomically and set the selection index correctlyThis makes autocomplete quicker to work with and matches how OpenCode works.
Follow-up to
This is a follow-up to #4708 by @jdm64 with test fixes applied.
Test plan
cd cli && npx vitest run src/state/atoms/__tests__/default-selection.test.ts- all 13 tests pass