Skip to content

Self-hosted AI workspace.

Python

fix: hide shell access and plan mode buttons in chat mode (#3417)

michaelxer387e2de09211
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();