Skip to content

Commit 6c2aa63

Browse files
brunobergherellipsis-dev[bot]roomotemrubens
authored
feat: Add keyboard shortcut for toggling auto-approve (Cmd/Ctrl+Alt+A) (#8214)
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com> Co-authored-by: Roo Code <[email protected]> Co-authored-by: Matt Rubens <[email protected]>
1 parent 6a4dab0 commit 6c2aa63

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+141
-16
lines changed

packages/types/src/vscode.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ export const commandIds = [
5353
"focusInput",
5454
"acceptInput",
5555
"focusPanel",
56+
"toggleAutoApprove",
5657
] as const
5758

5859
export type CommandId = (typeof commandIds)[number]

src/activate/registerCommands.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,18 @@ const getCommandsMap = ({ context, outputChannel, provider }: RegisterCommandOpt
221221

222222
visibleProvider.postMessageToWebview({ type: "acceptInput" })
223223
},
224+
toggleAutoApprove: async () => {
225+
const visibleProvider = getVisibleProviderOrLog(outputChannel)
226+
227+
if (!visibleProvider) {
228+
return
229+
}
230+
231+
visibleProvider.postMessageToWebview({
232+
type: "action",
233+
action: "toggleAutoApprove",
234+
})
235+
},
224236
})
225237

226238
export const openClineInNewTab = async ({ context, outputChannel }: Omit<RegisterCommandOptions, "provider">) => {

src/core/webview/webviewMessageHandler.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,6 +1044,18 @@ export const webviewMessageHandler = async (
10441044

10451045
break
10461046
}
1047+
case "openKeyboardShortcuts": {
1048+
// Open VSCode keyboard shortcuts settings and optionally filter to show the Roo Code commands
1049+
const searchQuery = message.text || ""
1050+
if (searchQuery) {
1051+
// Open with a search query pre-filled
1052+
await vscode.commands.executeCommand("workbench.action.openGlobalKeybindings", searchQuery)
1053+
} else {
1054+
// Just open the keyboard shortcuts settings
1055+
await vscode.commands.executeCommand("workbench.action.openGlobalKeybindings")
1056+
}
1057+
break
1058+
}
10471059
case "openMcpSettings": {
10481060
const mcpSettingsFilePath = await provider.getMcpHub()?.getMcpSettingsFilePath()
10491061

src/package.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,11 @@
174174
"command": "roo-cline.acceptInput",
175175
"title": "%command.acceptInput.title%",
176176
"category": "%configuration.title%"
177+
},
178+
{
179+
"command": "roo-cline.toggleAutoApprove",
180+
"title": "%command.toggleAutoApprove.title%",
181+
"category": "%configuration.title%"
177182
}
178183
],
179184
"menus": {
@@ -310,6 +315,13 @@
310315
"win": "ctrl+y",
311316
"linux": "ctrl+y",
312317
"when": "editorTextFocus && editorHasSelection"
318+
},
319+
{
320+
"command": "roo-cline.toggleAutoApprove",
321+
"key": "cmd+alt+a",
322+
"mac": "cmd+alt+a",
323+
"win": "ctrl+alt+a",
324+
"linux": "ctrl+alt+a"
313325
}
314326
],
315327
"submenus": [

src/package.nls.ca.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/package.nls.de.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/package.nls.es.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/package.nls.fr.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/package.nls.hi.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/package.nls.id.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)