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
39 changes: 39 additions & 0 deletions ui/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ let state = {
workspaceRecoveryEnabled: true,
sessionId: null,
lastSaveTimestamp: 0,
runningScripts: {}, // { termId: { run_id } }
terminalFontSize: parseInt(localStorage.getItem('terminal-font-size')) || 13,
runningScripts: {}, // termId -> { step, total, command, status }
reliabilitySummary: null,
reliabilityFailures: null,
Expand Down Expand Up @@ -3116,6 +3118,43 @@ function closeModal() {

// ─── Event Bindings ────────────────────────────────────────
function bindEvents() {
// ─── TERMINAL TEXT SIZE ZOOM PANEL ENGINE (#113) ───
const btnZoomIn = document.getElementById('btn-zoom-in');
const btnZoomOut = document.getElementById('btn-zoom-out');
const zoomDisplay = document.getElementById('terminal-zoom-display');
const terminalBody = document.getElementById('terminal-body');

// Sync rendering on startup routine
const applyTerminalFontSize = () => {
if (terminalBody) {
terminalBody.style.fontSize = `${state.terminalFontSize}px`;
}
if (zoomDisplay) {
zoomDisplay.textContent = `${state.terminalFontSize}px`;
}
localStorage.setItem('terminal-font-size', state.terminalFontSize);
};

// Initialize preference configurations instantly on event hook cycle
applyTerminalFontSize();

if (btnZoomIn) {
btnZoomIn.addEventListener('click', () => {
if (state.terminalFontSize < 20) { // Strict upper bounds constraint
state.terminalFontSize++;
applyTerminalFontSize();
}
});
}

if (btnZoomOut) {
btnZoomOut.addEventListener('click', () => {
if (state.terminalFontSize > 11) { // Strict lower bounds constraint
state.terminalFontSize--;
applyTerminalFontSize();
}
});
}
// Terminal Search
const cliSearchInput = document.getElementById('cli-search-input');
if (cliSearchInput) {
Expand Down
17 changes: 17 additions & 0 deletions ui/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,22 @@ <h2>Scripts</h2>
<span id="cli-search-results"></span>
</div>
<span class="run-status" id="run-status"></span>
<div class="terminal-zoom-controls" style="display: inline-flex; gap: 4px; margin-right: 4px; align-items: center;">
<button class="btn-icon" id="btn-zoom-out" title="Decrease Font Size" aria-label="Decrease font size">
<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">
<line x1="5" y1="12" x2="19" y2="12"></line>
</svg>
</button>
<span id="terminal-zoom-display" style="font-family: var(--font-mono, monospace); font-size: 11px; color: var(--text-muted, #8b949e); min-width: 28px; text-align: center;">13px</span>
<button class="btn-icon" id="btn-zoom-in" title="Increase Font Size" aria-label="Increase font size">
<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">
<line x1="12" y1="5" x2="12" y2="19"></line>
<line x1="5" y1="12" x2="19" y2="12"></line>
</svg>
</button>
</div>

<button class="btn-icon btn-clear" id="btn-clear" title="Clear Terminal" aria-label="Clear terminal">
<button class="btn-icon btn-clear" id="btn-clear" title="Clear Terminal"
aria-label="Clear terminal">
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24"
Expand All @@ -230,6 +246,7 @@ <h2>Scripts</h2>
</svg>
</button>
</div>
</div>
</div>
<!-- Progress Tracker Panel -->
<div id="progress-tracker-panel" class="progress-tracker-panel" style="display: none;">
Expand Down
Loading