mirror of
https://github.com/andrepimenta/claude-code-chat.git
synced 2025-12-08 17:49:43 +00:00
yolo mode warning
This commit is contained in:
@@ -216,6 +216,9 @@ class ClaudeChatProvider {
|
||||
|
||||
// Send platform information to webview
|
||||
this._sendPlatformInfo();
|
||||
|
||||
// Send current settings to webview
|
||||
this._sendCurrentSettings();
|
||||
}
|
||||
|
||||
private _handleWebviewMessage(message: any) {
|
||||
@@ -1772,7 +1775,8 @@ class ClaudeChatProvider {
|
||||
'wsl.enabled': config.get<boolean>('wsl.enabled', false),
|
||||
'wsl.distro': config.get<string>('wsl.distro', 'Ubuntu'),
|
||||
'wsl.nodePath': config.get<string>('wsl.nodePath', '/usr/bin/node'),
|
||||
'wsl.claudePath': config.get<string>('wsl.claudePath', '/usr/local/bin/claude')
|
||||
'wsl.claudePath': config.get<string>('wsl.claudePath', '/usr/local/bin/claude'),
|
||||
'permissions.yoloMode': config.get<boolean>('permissions.yoloMode', false)
|
||||
};
|
||||
|
||||
this._postMessage({
|
||||
|
||||
@@ -493,7 +493,7 @@ const styles = `
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
margin-top: 12px;
|
||||
opacity: 0.7;
|
||||
opacity: 0.8;
|
||||
transition: opacity 0.2s ease;
|
||||
}
|
||||
|
||||
@@ -1353,13 +1353,17 @@ const styles = `
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.beta-warning {
|
||||
font-size: 11px;
|
||||
color: var(--vscode-descriptionForeground);
|
||||
.yolo-warning {
|
||||
font-size: 12px;
|
||||
color: var(--vscode-inputValidation-errorForeground);
|
||||
text-align: center;
|
||||
font-style: italic;
|
||||
background-color: var(--vscode-panel-background);
|
||||
padding: 4px
|
||||
font-weight: 500;
|
||||
background-color: var(--vscode-inputValidation-errorBackground);
|
||||
border: 1px solid var(--vscode-inputValidation-errorBorder);
|
||||
padding: 8px 12px;
|
||||
margin: 4px 12px;
|
||||
border-radius: 4px;
|
||||
animation: slideDown 0.3s ease;
|
||||
}
|
||||
|
||||
.file-picker-modal {
|
||||
|
||||
21
src/ui.ts
21
src/ui.ts
@@ -131,8 +131,8 @@ const html = `<!DOCTYPE html>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="beta-warning">
|
||||
In Beta. All Claude Code tools are allowed. Use at your own risk.
|
||||
<div id="yoloWarning" class="yolo-warning" style="display: none;">
|
||||
⚠️ Yolo Mode Active: Claude Code can execute any tool without asking.
|
||||
</div>
|
||||
|
||||
<!-- File picker modal -->
|
||||
@@ -289,7 +289,7 @@ const html = `<!DOCTYPE html>
|
||||
+ add permission
|
||||
</button>
|
||||
<div class="yolo-mode-section">
|
||||
<input type="checkbox" id="yolo-mode" onchange="updateSettings()">
|
||||
<input type="checkbox" id="yolo-mode" onchange="updateSettings(); updateYoloWarning();">
|
||||
<label for="yolo-mode">Enable Yolo Mode (Skip All Permissions)</label>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1469,6 +1469,18 @@ const html = `<!DOCTYPE html>
|
||||
function showToolsModal() {
|
||||
document.getElementById('toolsModal').style.display = 'flex';
|
||||
}
|
||||
|
||||
function updateYoloWarning() {
|
||||
const yoloModeCheckbox = document.getElementById('yolo-mode');
|
||||
const warning = document.getElementById('yoloWarning');
|
||||
|
||||
if (!yoloModeCheckbox || !warning) {
|
||||
return; // Elements not ready yet
|
||||
}
|
||||
|
||||
const yoloMode = yoloModeCheckbox.checked;
|
||||
warning.style.display = yoloMode ? 'block' : 'none';
|
||||
}
|
||||
|
||||
function hideToolsModal() {
|
||||
document.getElementById('toolsModal').style.display = 'none';
|
||||
@@ -2705,6 +2717,9 @@ const html = `<!DOCTYPE html>
|
||||
document.getElementById('wsl-claude-path').value = message.data['wsl.claudePath'] || '/usr/local/bin/claude';
|
||||
document.getElementById('yolo-mode').checked = message.data['permissions.yoloMode'] || false;
|
||||
|
||||
// Update yolo warning visibility
|
||||
updateYoloWarning();
|
||||
|
||||
// Show/hide WSL options
|
||||
document.getElementById('wslOptions').style.display = message.data['wsl.enabled'] ? 'block' : 'none';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user