From e46446444e37de2c44042817d3ef43511b3bc627 Mon Sep 17 00:00:00 2001 From: megaproxy Date: Mon, 25 May 2026 22:11:03 +0100 Subject: [PATCH] Lock titlebar + pane toolbar height to stop periodic xterm reflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When the window or a pane was narrow, button text could wrap inside flex items, growing the toolbar by ~16px. That shrank .pane-wrap โ†’ ResizeObserver fired on every xterm โ†’ fit() reflowed text. Idle detection toggling " ยท N idle" in the titlebar was enough to flap a button across its wrap threshold every few seconds. Lock both bars to fixed heights with white-space:nowrap, flex-shrink:0 on children, and overflow:hidden. Items that don't fit clip silently instead of wrapping. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/App.css | 13 +++++++++++++ src/lib/layout/LeafPane.css | 12 +++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/src/App.css b/src/App.css index 3561b8c..ef7d4f3 100644 --- a/src/App.css +++ b/src/App.css @@ -16,6 +16,19 @@ font-size: 12px; color: #aaa; user-select: none; + /* Lock to a single row even when the window is narrow: buttons whose + text would otherwise wrap (e.g. "๐Ÿ“ก all off") would grow the + titlebar, shrink .pane-wrap, and reflow every xterm. nowrap stops + text-wrap inside buttons, flex-shrink:0 stops children from being + squeezed, height locks the row height, overflow:hidden clips items + that don't fit (widen the window to see them). */ + white-space: nowrap; + height: 34px; + box-sizing: border-box; + overflow: hidden; +} +.titlebar > * { + flex-shrink: 0; } .titlebar .label { font-weight: 600; diff --git a/src/lib/layout/LeafPane.css b/src/lib/layout/LeafPane.css index eeff96a..791a1e7 100644 --- a/src/lib/layout/LeafPane.css +++ b/src/lib/layout/LeafPane.css @@ -58,7 +58,17 @@ font-size: 11px; color: #aaa; user-select: none; - min-height: 24px; + height: 24px; + box-sizing: border-box; + /* Lock height: a narrow pane used to wrap toolbar items to 2+ rows, + which shrank the xterm beneath and reflowed the terminal. Clip + overflow instead of showing a scrollbar (which would itself eat + into the 24px and crush the buttons). */ + white-space: nowrap; + overflow: hidden; +} +.pane-toolbar > * { + flex-shrink: 0; } .pane-label { font: inherit;