From 5c564d8e25ac4a3b09cd1f190cad55a00c1f6278 Mon Sep 17 00:00:00 2001 From: Matt Rubens Date: Fri, 13 Dec 2024 18:58:25 -0500 Subject: [PATCH] Clean up the settings page --- .../src/components/settings/SettingsView.tsx | 298 ++++++++---------- 1 file changed, 135 insertions(+), 163 deletions(-) diff --git a/webview-ui/src/components/settings/SettingsView.tsx b/webview-ui/src/components/settings/SettingsView.tsx index 0290974..deab3d6 100644 --- a/webview-ui/src/components/settings/SettingsView.tsx +++ b/webview-ui/src/components/settings/SettingsView.tsx @@ -145,6 +145,20 @@ const SettingsView = ({ onDone }: SettingsViewProps) => {

+
+ setDiffEnabled(e.target.checked)}> + Enable editing through diffs + +

+ When enabled, Cline will be able to edit files more quickly and will automatically reject truncated full-file writes. +

+
+
{

-
- setAlwaysAllowWrite(e.target.checked)}> - Always approve write operations - -

- ⚠️ WARNING: When enabled, Cline will automatically create and edit files without requiring approval. This is potentially very dangerous and could lead to unwanted system modifications or security risks. Enable only if you fully trust the AI and understand the risks. +

+

⚠️ High-Risk Auto-Approve Settings

+

+ The following settings allow Cline to automatically perform potentially dangerous operations without requiring approval. + Enable these settings only if you fully trust the AI and understand the associated security risks.

-
-
- setAlwaysAllowBrowser(e.target.checked)}> - Always approve browser actions - -

- ⚠️ WARNING: When enabled, Cline will automatically perform browser actions without requiring approval. This is potentially very dangerous and could lead to unwanted system modifications or security risks. Enable only if you fully trust the AI and understand the risks.

NOTE: The checkbox only applies when the model supports computer use. -

-
- -
- { - setAlwaysAllowMcp(e.target.checked) - vscode.postMessage({ type: "alwaysAllowMcp", bool: e.target.checked }) - }}> - Always approve MCP tools - -

- ⚠️ WARNING: When enabled, you can set individual MCP tools to auto-approve in the MCP Servers view. A tool will only be auto-approved if both this setting and the tool's individual "Always allow" checkbox are enabled. This is potentially very dangerous and could lead to unwanted system modifications or security risks. Enable only if you fully trust the AI and understand the risks. -

-
- -
- setAlwaysAllowExecute(e.target.checked)}> - Always approve allowed execute operations - -

- ⚠️ WARNING: When enabled, Cline will automatically execute allowed terminal commands without requiring approval. This is potentially very dangerous and could lead to unwanted system modifications or security risks. Enable only if you fully trust the AI and understand the risks. -

-
- - {alwaysAllowExecute && (
-
- Allowed Auto-Execute Commands -

- Command prefixes that can be auto-executed when "Always approve execute operations" is enabled. -

- -
- setCommandInput(e.target.value)} - placeholder="Enter command prefix (e.g., 'git ')" - style={{ flexGrow: 1 }} - /> - - Add - -
- -
- {(allowedCommands ?? []).map((cmd, index) => ( -
- {cmd} - { - const newCommands = (allowedCommands ?? []).filter((_, i) => i !== index) - setAllowedCommands(newCommands) - vscode.postMessage({ - type: "allowedCommands", - commands: newCommands - }) - }} - > - - -
- ))} -
-
+ setAlwaysAllowWrite(e.target.checked)}> + Always approve write operations + +

+ Automatically create and edit files without requiring approval +

- )} + +
+ setAlwaysAllowBrowser(e.target.checked)}> + Always approve browser actions + +

+ Automatically perform browser actions without requiring approval
+ Note: Only applies when the model supports computer use +

+
+ +
+ { + setAlwaysAllowMcp(e.target.checked) + vscode.postMessage({ type: "alwaysAllowMcp", bool: e.target.checked }) + }}> + Always approve MCP tools + +

+ Enable auto-approval of individual MCP tools in the MCP Servers view (requires both this setting and the tool's individual "Always allow" checkbox) +

+
+ +
+ setAlwaysAllowExecute(e.target.checked)}> + Always approve allowed execute operations + +

+ Automatically execute allowed terminal commands without requiring approval +

+ + {alwaysAllowExecute && ( +
+ Allowed Auto-Execute Commands +

+ Command prefixes that can be auto-executed when "Always approve execute operations" is enabled. +

+ +
+ setCommandInput(e.target.value)} + placeholder="Enter command prefix (e.g., 'git ')" + style={{ flexGrow: 1 }} + /> + + Add + +
+ +
+ {(allowedCommands ?? []).map((cmd, index) => ( +
+ {cmd} + { + const newCommands = (allowedCommands ?? []).filter((_, i) => i !== index) + setAllowedCommands(newCommands) + vscode.postMessage({ + type: "allowedCommands", + commands: newCommands + }) + }} + > + + +
+ ))} +
+
+ )} +
+

Experimental Features

-
- setDiffEnabled(e.target.checked)}> - Enable editing through diffs - -

- When enabled, Cline will be able to apply diffs to make changes to files and will automatically reject truncated full-file edits. -

-
-
setSoundEnabled(e.target.checked)}> Enable sound effects