cli: terminal app follow-up, narrow-terminal guard test, hidden-box way out and width tests (#1562)

Row 69, built by Darkwing, approved by Dewey (comment 28048) and Filbert
(comment 28055) on manifest c68e6582. Sage gate on c6711453: cli 123/0,
queue 150/0, every scripts suite green.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-10-12 18:36:52 -05:00
co-authored by Claude Opus 5.5
parent 14c1484da4
commit 90d7ed6628
4 changed files with 103 additions and 8 deletions
+6 -1
View File
@@ -96,7 +96,12 @@ export class App {
render() {
if (this.closed) return this.frame;
this.frame = draw(this.state, { cols: this.cols, rows: this.rows, color: this.color, now: this.now() });
// A hidden decide box can't be confirmed with y, so the status line
// doesn't say it can.
const o = this.state.overlay;
const hidden = o?.kind === "decide" && !decideShown(o, this.cols, this.rows);
const state = hidden ? { ...this.state, status: "Too small to confirm here.", statusStyle: "warning" } : this.state;
this.frame = draw(state, { cols: this.cols, rows: this.rows, color: this.color, now: this.now() });
this.write(`\x1b[H\x1b[2J${this.frame.join("\r\n")}`);
return this.frame;
}
+3 -1
View File
@@ -377,7 +377,9 @@ function overlayBox(o, cols, room) {
if (o.kind === "help") return box("help", HELP, Math.min(84, cols - 2));
const w = Math.min(84, cols - 2);
if (o.kind === "decide") {
return decideBox(o, w, room) ?? box("decide", [["Too small to show this decision.", "warning"], o.asking ? "Any key answers No." : ["resolving…", "muted"]], w);
// The way out fits the 34 cells a 40-column box has, so the hidden box
// is never cut.
return decideBox(o, w, room) ?? box("decide", [["Too small to show this decision.", "warning"], o.asking ? "Any key answers No." : ["resolving…", "muted"], "Resize, or use mosaic decide."], w);
}
if (o.kind === "unknown") {
return box("outcome unknown", [[o.message, "warning"], "", "Nothing was retried, and the choice was not sent twice.", "", "v open the trail r re-read the inbox Esc back"], w);