From c96e1f0f527686197604e04d20de0bc60633d7ec Mon Sep 17 00:00:00 2001 From: Justin Parker Date: Wed, 18 Nov 2026 19:45:06 -0800 Subject: [PATCH] Draw a stranded finish screen's way out when the press goes unanswered by time alone AI Assisted --- scripts/test-web-console-page-session.mjs | 5 ++++- src/web-console/public/screens/core.js | 9 +++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/scripts/test-web-console-page-session.mjs b/scripts/test-web-console-page-session.mjs index 92f5522..661776d 100644 --- a/scripts/test-web-console-page-session.mjs +++ b/scripts/test-web-console-page-session.mjs @@ -11,7 +11,7 @@ import test from "node:test"; import assert from "node:assert/strict"; import fs from "node:fs"; import path from "node:path"; -import { pageSuite, openSession, itemCard, drawn, textOf, tempProject , fillBox, boxValue, sendAsk, styleOf } from "./page-test-helpers.mjs"; +import { pageSuite, openSession, itemCard, drawn, textOf, tempProject , fillBox, boxValue, sendAsk, styleOf, quiet } from "./page-test-helpers.mjs"; import { cli, until, HOME } from "./web-console-test-helpers.mjs"; import { STOP_HANDOFF_REPLY, HOME_REPLY } from "../src/web-console/public/answers.js"; import { CHAT_OFFLINE_TEXT } from "../src/web-console/public/chat.js"; @@ -1156,6 +1156,9 @@ async function strandedFinish(t, opts) { const main = s.page.locator("#main"); await main.getByRole("button", { name: "Review it now" }).click(); await main.getByRole("button", { name: "Review requested…" }).waitFor(); + // Let the page hear the press is saved while it is still fresh, as it does for a person: + // the way out then has to appear by time alone, with no frame to draw it. + await quiet(s.page, { quietMs: 1000 }); await s.page.clock.fastForward(200_000); await s.page.waitForFunction(() => document.body.innerText.includes("Plan2Code is not running")); return { s, main }; diff --git a/src/web-console/public/screens/core.js b/src/web-console/public/screens/core.js index 64fe181..433cccd 100644 --- a/src/web-console/public/screens/core.js +++ b/src/web-console/public/screens/core.js @@ -2616,6 +2616,7 @@ export function wireChrome() { // render and nothing was triggering one. Watch the flip and draw the rest. let wasAdrift = false; let wasPastGrace = false; +let wasPressStranded = false; export function startClock() { setInterval(checkIn, 5000); @@ -2637,6 +2638,14 @@ export function startClock() { wasPastGrace = past; if (page.S) renderFooter(); } + // A finished screen's press goes stranded by time alone, with no frame to say so: draw + // the card again so its way out (Start a New Session, or the command) appears with the + // status line that names it. + const strandedNow = pressStranded(); + if (strandedNow !== wasPressStranded) { + wasPressStranded = strandedNow; + if (page.S) render(); + } // The agent coming or going changes whether the chat can be used, with no // frame to say so: redraw the Ask pane when that flips. Even mid-typing: // the draft is saved on every keystroke and withFocus() keeps the caret,