yolo mode warning

This commit is contained in:
andrepimenta
2025-07-09 01:28:43 +01:00
parent 2e4c866da2
commit bad8c9a0a8
3 changed files with 34 additions and 11 deletions

View File

@@ -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';
}