fix(terminal): make the failed-load notice fit the narrowest terminal

A third pass in a real browser, at the widths this app actually renders at.

The notice a failed history load writes into the blanked pane was one
70-character sentence. At 430px that exactly filled the line; at 320px it
wrapped and left a lone '.' on a line of its own. The floor this app will
render at is 40 columns — reachable today by raising the font on a phone — so
the notice is three lines now, none over 25 columns, one fact each: what
failed, that the session is still alive, and what to do.

It says RELOAD rather than "reopen the tab" because `selectSession`
early-returns when the session is already active, so clicking the tab you are
already on retries nothing. The earlier wording named no next step at all,
which left a mostly-empty terminal and no way out of it.

CLAUDE.md no longer cites "758px reachable to the right" as evidence: that
figure is a property of the test content, not of the fix, and the file's value
is that a reader can trust a claim without re-deriving it. What is pinned
instead is the invariant that survives any content — the full pane width is
reachable, and removing the class returns scrollLeft to 0, so a resolved
mismatch cannot leave the pane parked off-screen.

Verified at 430, 360 and 320px against the shipped bundle, with the test
asserting the built asset carries the copy so an edit that never reached the
build fails rather than passing on the source's wording.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Rounak Datta
2026-09-22 13:57:40 +05:30
co-authored by Claude Opus 5
parent d9fa9ba1eb
commit e587d84590
2 changed files with 10 additions and 2 deletions
+9 -1
View File
@@ -7063,8 +7063,16 @@ class CodemanApp {
// still holding its previous content is stale, not empty, and stacking a
// notice on top of readable output is worse than the staleness.
if (clearedBeforeFresh && this.terminal) {
// Three short lines, none over 25 columns, because the narrowest
// terminal this app will render is the 40-column floor and a notice
// that wraps there leaves a lone '.' on a line of its own — measured at
// 320px, where a single 52-character sentence did exactly that.
// Each line is one fact: what failed, that the session is still alive,
// and what to do. The last says RELOAD rather than "reopen the tab",
// because `selectSession` early-returns when the session is already
// active, so clicking the tab you are already on retries nothing.
this.terminal.write(
'\r\n\x1b[2m Could not load this session\u2019s history. Live output continues below.\x1b[0m\r\n'
'\r\n\x1b[2m History did not load.\r\n Live output continues.\r\n Reload to try again.\x1b[0m\r\n'
);
}
// ⚠️ CLEAR, not 'failed'. `_setTerminalLoadState` only marks the TAB, and