Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2566,8 +2566,8 @@ def clear_history():
os.unlink(file_path)
elif os.path.isdir(file_path):
shutil.rmtree(file_path)
except Exception:
pass
except Exception as exc:
app.logger.warning("Failed to remove execution log %s: %s", file_path, exc)

# Clear session logs
if os.path.exists(SESSION_LOG_DIR):
Expand All @@ -2578,8 +2578,8 @@ def clear_history():
os.unlink(file_path)
elif os.path.isdir(file_path):
shutil.rmtree(file_path)
except Exception:
pass
except Exception as exc:
app.logger.warning("Failed to remove session log %s: %s", file_path, exc)

return jsonify({
'success': True,
Expand Down
41 changes: 41 additions & 0 deletions ui/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ let state = {
activeTerminalId: 1,
nextTerminalId: 2,
autoScroll: {}, // per-terminal auto-scroll toggle: { termId: bool }
terminalIsMaximized: false,
workspaceRestored: false,
workspaceProfiles: [],
restoreMode: 'full',
Expand Down Expand Up @@ -2468,6 +2469,37 @@ function downloadTerminalLog() {
notify(`Log downloaded as "${filename}".`, 'success');
}

function updateMaximizeTerminalButton() {
const btn = document.getElementById('btn-maximize-terminal');
if (!btn) return;

const isMaximized = state.terminalIsMaximized;
btn.classList.toggle('active', isMaximized);
btn.setAttribute('aria-pressed', String(isMaximized));
btn.title = isMaximized ? 'Restore terminal layout' : 'Maximize terminal view';
btn.setAttribute(
'aria-label',
isMaximized ? 'Restore terminal layout' : 'Maximize terminal view'
);
}

function setTerminalMaximized(isMaximized) {
state.terminalIsMaximized = Boolean(isMaximized);
const appMain = document.getElementById('app-main');
if (appMain) {
appMain.classList.toggle('terminal-maximized', state.terminalIsMaximized);
}
updateMaximizeTerminalButton();
}

function toggleTerminalMaximized() {
setTerminalMaximized(!state.terminalIsMaximized);
notify(
state.terminalIsMaximized ? 'Terminal focus view enabled.' : 'Terminal layout restored.',
'info'
);
}

/**
* Toggles auto-scroll on/off for the active terminal.
* Updates the button appearance to reflect current state.
Expand Down Expand Up @@ -3465,6 +3497,12 @@ function bindEvents() {
btnDownloadLog.addEventListener('click', downloadTerminalLog);
}

const btnMaximizeTerminal = document.getElementById('btn-maximize-terminal');
if (btnMaximizeTerminal) {
btnMaximizeTerminal.addEventListener('click', toggleTerminalMaximized);
updateMaximizeTerminalButton();
}

const btnAutoscroll = document.getElementById('btn-autoscroll');
if (btnAutoscroll) {
btnAutoscroll.addEventListener('click', toggleAutoScroll);
Expand Down Expand Up @@ -3550,6 +3588,9 @@ function bindEvents() {
searchInput.focus();
}
if (e.key === 'Escape') {
if (state.terminalIsMaximized) {
setTerminalMaximized(false);
}
// close any active modal
document.querySelectorAll('.modal-overlay').forEach(el => el.classList.remove('active'));
if (document.activeElement === searchInput) {
Expand Down
11 changes: 11 additions & 0 deletions ui/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,17 @@ <h2>Scripts</h2>
<line x1="12" x2="12" y1="15" y2="3" />
</svg>
</button>
<button class="btn-icon" id="btn-maximize-terminal" title="Maximize terminal view"
aria-label="Maximize terminal view" aria-pressed="false">
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24"
fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
stroke-linejoin="round">
<path d="M15 3h6v6" />
<path d="m21 3-7 7" />
<path d="M9 21H3v-6" />
<path d="m3 21 7-7" />
</svg>
</button>
<button class="btn-icon" id="btn-autoscroll" title="Auto-scroll: On"
aria-label="Toggle auto-scroll" aria-pressed="true">
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24"
Expand Down
13 changes: 13 additions & 0 deletions ui/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,19 @@ body {
min-width: 0;
}

#app-main.terminal-maximized #sidebar,
#app-main.terminal-maximized #analysis-panel,
#app-main.terminal-maximized .resizer {
display: none !important;
}

#app-main.terminal-maximized #left-panel,
#app-main.terminal-maximized #cli-area {
flex: 1 1 100%;
width: 100%;
max-width: none;
}

/* ─── Resizers ────────────────────────────────────────── */
.resizer {
width: 6px;
Expand Down
Loading