Skip to content

Commit 1d71a72

Browse files
committed
Link to keybinding settings
1 parent 4837850 commit 1d71a72

File tree

21 files changed

+54
-19
lines changed

21 files changed

+54
-19
lines changed

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/shared/WebviewMessage.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ export interface WebviewMessage {
102102
| "browserViewportSize"
103103
| "screenshotQuality"
104104
| "remoteBrowserHost"
105+
| "openKeyboardShortcuts"
105106
| "openMcpSettings"
106107
| "openProjectMcpSettings"
107108
| "restartMcpServer"

webview-ui/src/components/settings/AutoApproveSettings.tsx

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { HTMLAttributes, useState } from "react"
22
import { X, CheckCheck } from "lucide-react"
3+
import { Trans } from "react-i18next"
4+
import { Package } from "@roo/package"
35

46
import { useAppTranslation } from "@/i18n/TranslationContext"
57
import { VSCodeCheckbox } from "@vscode/webview-ui-toolkit/react"
@@ -135,7 +137,27 @@ export const AutoApproveSettings = ({
135137
</VSCodeCheckbox>
136138
<div className="text-vscode-descriptionForeground text-sm mt-1">
137139
<p>{t("settings:autoApprove.description")}</p>
138-
<p>{t("settings:autoApprove.toggleShortcut")}</p>
140+
<p>
141+
<Trans
142+
i18nKey="settings:autoApprove.toggleShortcut"
143+
components={{
144+
SettingsLink: (
145+
<a
146+
href="#"
147+
className="text-vscode-textLink-foreground hover:underline cursor-pointer"
148+
onClick={(e) => {
149+
e.preventDefault()
150+
// Send message to open keyboard shortcuts with search for toggle command
151+
vscode.postMessage({
152+
type: "openKeyboardShortcuts",
153+
text: `${Package.name}.toggleAutoApprove`,
154+
})
155+
}}
156+
/>
157+
),
158+
}}
159+
/>
160+
</p>
139161
</div>
140162

141163
<AutoApproveToggle

webview-ui/src/i18n/locales/ca/settings.json

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

webview-ui/src/i18n/locales/de/settings.json

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

webview-ui/src/i18n/locales/en/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
},
136136
"autoApprove": {
137137
"description": "Run these actions without asking for permission. Only enable for actions you fully trust and if you understand the security risks.",
138-
"toggleShortcut": "You can configure a global shortcut for this setting in your IDE preferences.",
138+
"toggleShortcut": "You can configure a keyboard shortcut for this setting <SettingsLink>in your IDE preferences</SettingsLink>.",
139139
"enabled": "Auto-Approve Enabled",
140140
"readOnly": {
141141
"label": "Read",

webview-ui/src/i18n/locales/es/settings.json

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

webview-ui/src/i18n/locales/fr/settings.json

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

webview-ui/src/i18n/locales/hi/settings.json

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

webview-ui/src/i18n/locales/id/settings.json

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

0 commit comments

Comments
 (0)