mirror of
https://github.com/jparkerweb/plan2code.git
synced 2026-11-18 21:01:19 -08:00
Draw a stranded finish screen's way out when the press goes unanswered by time alone
AI Assisted
This commit is contained in:
1 parent
3b09d03090
commit
c96e1f0f52
2 files changed
+13
-1
No files matched your search
@@ -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 };
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user