-
Notifications
You must be signed in to change notification settings - Fork 1.6k
cli: Add Autocomplete For Mode #4730
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
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 1e7860a The changes in this PR will be included in the next version bump. 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 |
|
| Severity | Issue | Location |
|---|---|---|
| WARNING | Indentation inconsistency - extra tabs in code block | cli/src/state/hooks/useCommandInput.ts:269-296 |
| SUGGESTION | Unintended Git LFS hooks committed | .husky/_/ files |
Recommendation: Address the indentation issue before merge. The husky files should be removed from this PR.
Review Details (10 files)
Files Reviewed:
cli/src/commands/mode.ts- Main autocomplete implementation ✅cli/src/commands/core/types.ts- Type addition ✅cli/src/services/autocomplete.ts- Context update ✅cli/src/state/hooks/useCommandInput.ts- Context update (1 issue)cli/src/commands/__tests__/mode.autocomplete.test.ts- New tests ✅.changeset/mode-autocomplete.md- Changeset ✅.husky/_/post-checkout,post-commit,post-merge,pre-push- Unintended files
Checked: Security, bugs, code style, error handling
Summary: The core implementation follows the existing pattern from /model autocomplete and looks correct. The modeAutocompleteProvider properly retrieves custom modes from context and formats suggestions with source labels. Tests are comprehensive.
|
| Severity | Issue | Location |
|---|---|---|
| WARNING | Indentation inconsistency | cli/src/state/hooks/useCommandInput.ts:292 |
Recommendation: Address the indentation issue before merge
Review Details (6 files)
Files reviewed:
.changeset/mode-autocomplete.md- ✅ Appropriate changesetcli/src/commands/__tests__/mode.autocomplete.test.ts- ✅ Comprehensive tests following existing patternscli/src/commands/core/types.ts- ✅ Type addition is correctcli/src/commands/mode.ts- ✅ Clean refactor with proper autocomplete providercli/src/services/autocomplete.ts- ✅ Correctly passes customModes through contextcli/src/state/hooks/useCommandInput.ts-⚠️ Indentation issue (1 issue)
Checked: Security, bugs, performance, error handling, code style
Notes:
- The autocomplete implementation follows the established pattern from
/modelcommand - The
formatSourceLabelfunction correctly handles all source types includingundefined - Test structure mirrors
model.autocomplete.test.tsappropriately - Line 292 has a single tab on what should be an empty line (see inline comment for fix)
Adds tab autocomplete support for the /mode command in the CLI, matching the existing autocomplete behavior for /model.