diff --git a/muxplex/frontend/app.js b/muxplex/frontend/app.js index 262e09a..3bf8a70 100644 --- a/muxplex/frontend/app.js +++ b/muxplex/frontend/app.js @@ -804,6 +804,13 @@ function toggleSidebar() { var collapseBtn = $('sidebar-collapse-btn'); if (collapseBtn) collapseBtn.textContent = isOpen ? '\u2039' : '\u203a'; + + // Refit xterm.js after the sidebar CSS transition completes (0.25s ease). + // 'width' fires on desktop (flex layout); 'transform' fires on mobile (overlay). + sidebar.addEventListener('transitionend', function(e) { + if (e.propertyName !== 'width' && e.propertyName !== 'transform') return; + if (window._refitTerminal) window._refitTerminal(); + }, { once: true }); } /** diff --git a/muxplex/frontend/terminal.js b/muxplex/frontend/terminal.js index b73bfd7..fb4a812 100644 --- a/muxplex/frontend/terminal.js +++ b/muxplex/frontend/terminal.js @@ -542,6 +542,13 @@ function setTerminalFontSize(size) { window._setTerminalFontSize = setTerminalFontSize; +// Refit the terminal to its container dimensions. +// Call after layout changes (e.g. sidebar toggle) that alter available space. +window._refitTerminal = function() { + if (!_fitAddon) return; + try { _fitAddon.fit(); } catch (_) {} +}; + // --------------------------------------------------------------------------- // Mobile touch scroll — rAF-batched WheelEvent dispatch // Mobile devices batch touchmove events irregularly; dispatching one WheelEvent diff --git a/pyproject.toml b/pyproject.toml index ee61367..53bb426 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "muxplex" -version = "0.4.4" +version = "0.4.5" description = "Web-based tmux session dashboard — access all your tmux sessions from any browser" readme = "README.md" license = { text = "MIT" } diff --git a/uv.lock b/uv.lock index 59e2a8e..a6fc4fd 100644 --- a/uv.lock +++ b/uv.lock @@ -332,7 +332,7 @@ wheels = [ [[package]] name = "muxplex" -version = "0.4.4" +version = "0.4.5" source = { editable = "." } dependencies = [ { name = "aiofiles" },