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