Compare commits

...
5 Commits
9 changed files with 42 additions and 21 deletions

No files matched your search

+7 -7
View File
@@ -30,7 +30,7 @@ jobs:
outputs: outputs:
code: ${{ steps.diff.outputs.code }} code: ${{ steps.diff.outputs.code }}
steps: steps:
- uses: actions/checkout@v4.2.2 - uses: actions/checkout@v7.0.1
with: with:
fetch-depth: 0 fetch-depth: 0
- id: diff - id: diff
@@ -60,8 +60,8 @@ jobs:
name: prose checks name: prose checks
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4.2.2 - uses: actions/checkout@v7.0.1
- uses: actions/setup-node@v4.4.0 - uses: actions/setup-node@v7.1.0
with: with:
node-version: 20 node-version: 20
- name: Versions agree - name: Versions agree
@@ -82,8 +82,8 @@ jobs:
run: run:
working-directory: plan2code-app working-directory: plan2code-app
steps: steps:
- uses: actions/checkout@v4.2.2 - uses: actions/checkout@v7.0.1
- uses: actions/setup-node@v4.4.0 - uses: actions/setup-node@v7.1.0
with: with:
node-version: 20 node-version: 20
cache: npm cache: npm
@@ -179,8 +179,8 @@ jobs:
matrix: matrix:
os: [windows-latest, macos-latest, ubuntu-latest] os: [windows-latest, macos-latest, ubuntu-latest]
steps: steps:
- uses: actions/checkout@v4.2.2 - uses: actions/checkout@v7.0.1
- uses: actions/setup-node@v4.4.0 - uses: actions/setup-node@v7.1.0
with: with:
node-version: 20 node-version: 20
- name: Cache the npm downloads - name: Cache the npm downloads
+4 -4
View File
@@ -27,8 +27,8 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
timeout-minutes: 20 timeout-minutes: 20
steps: steps:
- uses: actions/checkout@v4.2.2 - uses: actions/checkout@v7.0.1
- uses: actions/setup-node@v4.4.0 - uses: actions/setup-node@v7.1.0
with: with:
node-version: 20 node-version: 20
- name: Cache the npm downloads - name: Cache the npm downloads
@@ -60,8 +60,8 @@ jobs:
run: run:
shell: bash shell: bash
steps: steps:
- uses: actions/checkout@v4.2.2 - uses: actions/checkout@v7.0.1
- uses: actions/setup-node@v4.4.0 - uses: actions/setup-node@v7.1.0
with: with:
node-version: 20 node-version: 20
- name: Cache the npm downloads - name: Cache the npm downloads
+5 -5
View File
@@ -64,10 +64,10 @@ jobs:
run: run:
shell: bash shell: bash
steps: steps:
- uses: actions/checkout@v4.2.2 - uses: actions/checkout@v7.0.1
with: with:
persist-credentials: false persist-credentials: false
- uses: actions/setup-node@v4.4.0 - uses: actions/setup-node@v7.1.0
with: with:
node-version: 22 node-version: 22
cache: npm cache: npm
@@ -121,7 +121,7 @@ jobs:
VERSION="$(node -p "require('./plan2code-app/src-tauri/tauri.conf.json').version")" VERSION="$(node -p "require('./plan2code-app/src-tauri/tauri.conf.json').version")"
mkdir -p dist mkdir -p dist
cp "plan2code-app/target/release/${{ matrix.built }}" "dist/plan2code-app-${VERSION}-${{ matrix.label }}${{ matrix.suffix }}" cp "plan2code-app/target/release/${{ matrix.built }}" "dist/plan2code-app-${VERSION}-${{ matrix.label }}${{ matrix.suffix }}"
- uses: actions/upload-artifact@v4.6.2 - uses: actions/upload-artifact@v7.0.2
with: with:
name: app-${{ matrix.label }} name: app-${{ matrix.label }}
path: dist/* path: dist/*
@@ -136,8 +136,8 @@ jobs:
env: env:
GH_TOKEN: ${{ github.token }} GH_TOKEN: ${{ github.token }}
steps: steps:
- uses: actions/checkout@v4.2.2 - uses: actions/checkout@v7.0.1
- uses: actions/download-artifact@v4.3.0 - uses: actions/download-artifact@v8.0.2
with: with:
path: dist path: dist
pattern: app-* pattern: app-*
+2 -1
View File
@@ -374,7 +374,8 @@ test("wait reads --seconds 6s as six seconds, not as nothing", () => {
}); });
test("only an installed console's open leaves the console-dir pointer; status, help, a bad command and a source checkout's open do not", () => { test("only an installed console's open leaves the console-dir pointer; status, help, a bad command and a source checkout's open do not", () => {
const home = fs.mkdtempSync(path.join(os.tmpdir(), "p2c-pointer-")); // macOS hands out a temp folder under the /var link, and the console writes the real path.
const home = fs.realpathSync(fs.mkdtempSync(path.join(os.tmpdir(), "p2c-pointer-")));
const env = { PLAN2CODE_CONSOLE_HOME: home, PLAN2CODE_MODELS_DIR: path.join(home, "plan2code") }; const env = { PLAN2CODE_CONSOLE_HOME: home, PLAN2CODE_MODELS_DIR: path.join(home, "plan2code") };
const pointer = path.join(home, "console-dir"); const pointer = path.join(home, "console-dir");
fs.writeFileSync(path.join(home, "update-check.json"), JSON.stringify({ checkedAt: Date.now(), latest: null })); fs.writeFileSync(path.join(home, "update-check.json"), JSON.stringify({ checkedAt: Date.now(), latest: null }));
+2 -2
View File
@@ -96,7 +96,7 @@ test("a press in the empty part of the answer box selects like a textarea: Shift
const range = () => host.evaluate((el) => [el.field.selectionStart, el.field.selectionEnd]); const range = () => host.evaluate((el) => [el.field.selectionStart, el.field.selectionEnd]);
const box = await host.boundingBox(); const box = await host.boundingBox();
const low = { x: box.x + box.width / 2, y: box.y + box.height - 12 }; const low = { x: box.x + box.width / 2, y: box.y + box.height - 12 };
assert.equal(await host.evaluate((el) => getComputedStyle(el).cursor), "text", "the whole box shows the text pointer"); assert.equal(await styleOf(host, "cursor"), "text", "the whole box shows the text pointer");
await s.page.keyboard.press("Home"); await s.page.keyboard.press("Home");
// page.mouse takes no modifiers option: hold Shift on the keyboard. // page.mouse takes no modifiers option: hold Shift on the keyboard.
@@ -621,7 +621,7 @@ test("a note box over the git board grows no box, and the card flows at its own
project: dir, project: dir,
payload: { reread: true, board: { describe: "export-more" }, items: [confirm] }, payload: { reread: true, board: { describe: "export-more" }, items: [confirm] },
}); });
await git.page.getByRole("tablist").waitFor(); await git.page.locator(".git-step").first().waitFor();
const gitCard = itemCard(git.page, "y1"); const gitCard = itemCard(git.page, "y1");
await gitCard.waitFor(); await gitCard.waitFor();
const note = gitCard.locator(".md-host").first(); const note = gitCard.locator(".md-host").first();
+8
View File
@@ -91,6 +91,14 @@ test("each git tab keeps its own scroll place, across a tab switch and an agent
await tab("Changes").click(); await tab("Changes").click();
await page.getByRole("tabpanel").getByText(/in the Save step above/).waitFor(); await page.getByRole("tabpanel").getByText(/in the Save step above/).waitFor();
await scrollCard(page.locator("#main"), 120); await scrollCard(page.locator("#main"), 120);
// The tabs sit below this short window, so a click on one scrolls the column to it first:
// a scroll like the person's own, which the board notes. Make it now and give the page a
// moment to note it, so the place Changes is left at is known before the switch.
// Done in the page in one step: a redraw may swap the tab for a new one at any moment.
await page.evaluate(() => {
document.getElementById("git-tab-branches").scrollIntoView({ block: "center" });
return new Promise((r) => requestAnimationFrame(() => requestAnimationFrame(r)));
});
const changesAt = await column(); const changesAt = await column();
assert.ok(changesAt > 0, "the board's column scrolls"); assert.ok(changesAt > 0, "the board's column scrolls");
// Another tab opens at its own place, not where Changes was left. // Another tab opens at its own place, not where Changes was left.
+1 -1
View File
@@ -544,7 +544,7 @@ test("each tab keeps its own text and pictures, and switching never saves into t
const notes = idOf(s, "Notes"); const notes = idOf(s, "Notes");
const ideas = idOf(s, "Ideas"); const ideas = idOf(s, "Ideas");
// The new tab opens with its heading and the editor focused: clear it to start from empty. // The new tab opens with its heading and the editor focused: clear it to start from empty.
await s.page.keyboard.press("Control+a"); await s.page.keyboard.press("ControlOrMeta+a");
await s.page.keyboard.press("Delete"); await s.page.keyboard.press("Delete");
await until(() => readNotepad(s.project, notes).text === "notes text" && readNotepad(s.project, ideas).text === "", 4000); await until(() => readNotepad(s.project, notes).text === "notes text" && readNotepad(s.project, ideas).text === "", 4000);
await typeInto(s, "ideas text"); await typeInto(s, "ideas text");
+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,