From 118e4af57452fa9bbdd2adad097389e7336c80b7 Mon Sep 17 00:00:00 2001 From: CodeKing Date: Wed, 24 Jun 2026 11:37:38 +0500 Subject: [PATCH] Fix: auto-enable autoApprovalEnabled master switch when toggling individual settings in Settings page Mirrors the behavior from AutoApproveDropdown.tsx where enabling any individual auto-approve toggle also enables the master switch. --- .../src/components/settings/AutoApproveSettings.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/webview-ui/src/components/settings/AutoApproveSettings.tsx b/webview-ui/src/components/settings/AutoApproveSettings.tsx index 40e1658f5f..14373b975e 100644 --- a/webview-ui/src/components/settings/AutoApproveSettings.tsx +++ b/webview-ui/src/components/settings/AutoApproveSettings.tsx @@ -157,7 +157,14 @@ export const AutoApproveSettings = ({ alwaysAllowSubtasks={alwaysAllowSubtasks} alwaysAllowExecute={alwaysAllowExecute} alwaysAllowFollowupQuestions={alwaysAllowFollowupQuestions} - onToggle={(key, value) => setCachedStateField(key, value)} + onToggle={(key, value) => { + setCachedStateField(key, value) + // Auto-enable master switch when enabling any individual toggle + if (value && !autoApprovalEnabled) { + setAutoApprovalEnabled(true) + vscode.postMessage({ type: "autoApprovalEnabled", bool: true }) + } + }} />