From 233390546c05c33a2e767e1cb659c61a24ce55ab Mon Sep 17 00:00:00 2001 From: michaelxer <52305679+michaelxer@users.noreply.github.com> Date: Mon, 8 Jun 2026 16:32:37 +0700 Subject: [PATCH] fix: hide shell access and plan mode buttons in chat mode (#3417) When in chat mode, the shell access and plan mode buttons should not be visible. These buttons are only relevant in agent mode where the AI can use shell commands and planning features. Changes: - Modified applyModeToToggles() to hide bash-toggle-btn and plan-toggle-btn when mode is 'chat' - Added immediate hiding on page load to prevent flash of buttons - Buttons are shown again when switching to agent mode Fixes #3411 Co-authored-by: michaelxer --- static/app.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/static/app.js b/static/app.js index be94aef4c..8216d6485 100644 --- a/static/app.js +++ b/static/app.js @@ -1591,7 +1591,15 @@ function initializeEventListeners() { function applyModeToToggles(mode) { MODE_TOOLS.forEach(({ btnId, checkboxId, stateKey }) => { const btn = el(btnId); - if (!btn || btn.style.display === 'none') return; + if (!btn) return; + // Hide bash and plan buttons in chat mode + if (mode === 'chat' && (stateKey === 'bash' || stateKey === 'plan')) { + btn.style.display = 'none'; + return; + } + // Show buttons in agent mode (or for web toggle in any mode) + btn.style.display = ''; + if (btn.style.display === 'none') return; const on = loadToolPref(stateKey, mode); btn.classList.toggle('active', on); if (checkboxId) { const chk = el(checkboxId); if (chk) chk.checked = on; } @@ -1606,6 +1614,14 @@ function initializeEventListeners() { const state = loadToggleState(); let currentMode = state.mode || 'chat'; + // Immediately hide bash/plan buttons in chat mode on page load + if (currentMode === 'chat') { + const bashBtn = el('bash-toggle-btn'); + const planBtn = el('plan-toggle-btn'); + if (bashBtn) bashBtn.style.display = 'none'; + if (planBtn) planBtn.style.display = 'none'; + } + function setMode(mode) { currentMode = mode; const st = loadToggleState();