Draw a stranded finish screen's way out when the press goes unanswered by time alone

AI Assisted
This commit is contained in:
jparkerweb committed 2026-11-18 19:45:06 -08:00
1 parent 3b09d03090
commit c96e1f0f52
2 files changed
+13 -1

No files matched your search

+4 -1
View File
@@ -11,7 +11,7 @@ import test from "node:test";
import assert from "node:assert/strict"; import assert from "node:assert/strict";
import fs from "node:fs"; import fs from "node:fs";
import path from "node:path"; 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 { cli, until, HOME } from "./web-console-test-helpers.mjs";
import { STOP_HANDOFF_REPLY, HOME_REPLY } from "../src/web-console/public/answers.js"; import { STOP_HANDOFF_REPLY, HOME_REPLY } from "../src/web-console/public/answers.js";
import { CHAT_OFFLINE_TEXT } from "../src/web-console/public/chat.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"); const main = s.page.locator("#main");
await main.getByRole("button", { name: "Review it now" }).click(); await main.getByRole("button", { name: "Review it now" }).click();
await main.getByRole("button", { name: "Review requested…" }).waitFor(); 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.clock.fastForward(200_000);
await s.page.waitForFunction(() => document.body.innerText.includes("Plan2Code is not running")); await s.page.waitForFunction(() => document.body.innerText.includes("Plan2Code is not running"));
return { s, main }; return { s, main };
+9
View File
@@ -2616,6 +2616,7 @@ export function wireChrome() {
// render and nothing was triggering one. Watch the flip and draw the rest. // render and nothing was triggering one. Watch the flip and draw the rest.
let wasAdrift = false; let wasAdrift = false;
let wasPastGrace = false; let wasPastGrace = false;
let wasPressStranded = false;
export function startClock() { export function startClock() {
setInterval(checkIn, 5000); setInterval(checkIn, 5000);
@@ -2637,6 +2638,14 @@ export function startClock() {
wasPastGrace = past; wasPastGrace = past;
if (page.S) renderFooter(); 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 // 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: // 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, // the draft is saved on every keystroke and withFocus() keeps the caret,