-
Notifications
You must be signed in to change notification settings - Fork 2.6k
feat: add global command to toggle Auto-Approve with keybinding #8073
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
- Add new command "roo-cline.toggleAutoApprove" to package.json - Register command handler in registerCommands.ts to toggle autoApprovalEnabled state - Add default keybinding Ctrl+Shift+A (Cmd+Shift+A on Mac) - Update CommandId type definition to include new command - Add localization for command title Fixes #8072
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewing my own code is like debugging in a mirror - everything looks backwards but the bugs are still mine.
| // Show notification to user | ||
| const statusText = newState ? "enabled" : "disabled" | ||
| vscode.window.showInformationMessage(`Auto-Approve ${statusText}`) | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing unit tests for the new toggleAutoApprove command. Would be good to add tests similar to the existing getVisibleProviderOrLog tests to verify:
- The toggle functionality works correctly
- The state is properly updated
- The webview receives the update
- The notification is shown
src/activate/registerCommands.ts
Outdated
|
|
||
| // Show notification to user | ||
| const statusText = newState ? "enabled" : "disabled" | ||
| vscode.window.showInformationMessage(`Auto-Approve ${statusText}`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The notification message should be internationalized. Consider using:
This would require adding the corresponding keys to the localization files.
| "key": "ctrl+shift+a", | ||
| "mac": "cmd+shift+a", | ||
| "win": "ctrl+shift+a", | ||
| "linux": "ctrl+shift+a" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The keybinding Ctrl+Shift+A (Cmd+Shift+A on Mac) might conflict with other extensions or VS Code defaults. While this works, consider documenting this in the README or checking for potential conflicts with common extensions.
- Replace hardcoded English status text with translated versions - Add status.enabled and status.disabled translations to all 18 language files - Update notification to use t() function for proper i18n support - Ensures Auto-Approve status displays in user's selected language Addresses PR #8073 review feedback
|
Closing in favor of #8214 |
Description
This PR adds a global command to toggle the Auto-Approve setting with keyboard shortcut support, addressing Issue #8072.
Changes
roo-cline.toggleAutoApproveto package.jsonTesting
Notes
The review identified two minor improvements that could be addressed in a follow-up:
These don't affect the core functionality and can be addressed separately if needed.
Fixes #8072
Important
Adds
toggleAutoApprovecommand with keybinding and notification, updates localization, and suggests future improvements.roo-cline.toggleAutoApprovecommand inpackage.jsonto toggleautoApprovalEnabledstate.Ctrl+Shift+A(Cmd+Shift+A on Mac) added inpackage.json.registerCommands.ts.toggleAutoApprovecommand notification incommon.jsonacross multiple languages.This description was created by
for 314feb0. You can customize this summary. It will automatically update as commits are pushed.