Browse Source

Merge pull request #513 from RooVetGit/fix_custom_modes_settings_button

Fix button to open custom modes settings
Matt Rubens 11 months ago
parent
commit
1555a4f055

+ 5 - 0
.changeset/happy-camels-rhyme.md

@@ -0,0 +1,5 @@
+---
+"roo-cline": patch
+---
+
+Fix button to open custom modes settings

+ 7 - 0
src/core/webview/ClineProvider.ts

@@ -655,6 +655,13 @@ export class ClineProvider implements vscode.WebviewViewProvider {
 						}
 						break
 					}
+					case "openCustomModesSettings": {
+						const customModesFilePath = await this.customModesManager.getCustomModesFilePath()
+						if (customModesFilePath) {
+							openFile(customModesFilePath)
+						}
+						break
+					}
 					case "restartMcpServer": {
 						try {
 							await this.mcpHub?.restartConnection(message.text!)

+ 1 - 0
src/shared/WebviewMessage.ts

@@ -77,6 +77,7 @@ export interface WebviewMessage {
 		| "updateCustomMode"
 		| "deleteCustomMode"
 		| "setopenAiCustomModelInfo"
+		| "openCustomModesSettings"
 	text?: string
 	disabled?: boolean
 	askResponse?: ClineAskResponse

+ 1 - 2
webview-ui/src/components/prompts/PromptsView.tsx

@@ -434,8 +434,7 @@ const PromptsView = ({ onDone }: PromptsViewProps) => {
 								title="Edit modes configuration"
 								onClick={() => {
 									vscode.postMessage({
-										type: "openFile",
-										text: "settings/cline_custom_modes.json",
+										type: "openCustomModesSettings",
 									})
 								}}>
 								<span className="codicon codicon-json"></span>