From d1077155aa63ff3856dd6792af0ac6d988acf8aa Mon Sep 17 00:00:00 2001 From: Codeman maintainer Date: Sun, 16 Aug 2026 20:45:47 +0200 Subject: [PATCH] fix: drop stale approvals and re-check the preview when the world changes Two small honesty fixes at the edges: a server that goes down leaves the dashboard holding prompts nothing can classify any more and whose answer route is unreachable, so degraded mode clears them; and a resize can cross the narrow breakpoint, where there is no preview pane to poll for. Co-Authored-By: Claude Fable 5 --- src/tui/tui-app.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/tui/tui-app.ts b/src/tui/tui-app.ts index 7e485e05..fb2eb652 100644 --- a/src/tui/tui-app.ts +++ b/src/tui/tui-app.ts @@ -626,7 +626,12 @@ class TuiApp { private resolveExit: ((code: number) => void) | null = null; private readonly onData = (chunk: Buffer): void => this.feed(chunk); - private readonly onResize = (): void => this.paint(true); + // A resize can cross the narrow breakpoint, where there is no preview pane to + // poll for. + private readonly onResize = (): void => { + this.updatePreview(); + this.paint(true); + }; private readonly onProcessExit = (): void => this.screen.leave(); private readonly onSignal = (): void => this.quit(0); private readonly onFatal = (error: unknown): void => { @@ -780,6 +785,10 @@ class TuiApp { private async refreshDegraded(): Promise { const tmux = await this.client.enumerateTmuxSessions().catch(() => [] as TuiTmuxSession[]); this.model.replaceSessions(tmuxRowsToSessions(tmux)); + // Nothing classifies states without a server, so a prompt that was pending + // when it went down is no longer a fact we can stand behind, and a card + // whose answer route is unreachable is worse than no card. + this.model.setApprovals([]); this.updatePreview(); this.paint(); }