mirror of
https://github.com/jparkerweb/plan2code.git
synced 2026-11-18 21:01:19 -08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
09fb4f4eec | ||
|
|
c96e1f0f52 | ||
|
|
3b09d03090 | ||
|
|
ce073cd07a | ||
|
|
65fbd1bfe1 |
No files matched your search
@@ -30,7 +30,7 @@ jobs:
|
||||
outputs:
|
||||
code: ${{ steps.diff.outputs.code }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4.2.2
|
||||
- uses: actions/checkout@v7.0.1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- id: diff
|
||||
@@ -60,8 +60,8 @@ jobs:
|
||||
name: prose checks
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4.2.2
|
||||
- uses: actions/setup-node@v4.4.0
|
||||
- uses: actions/checkout@v7.0.1
|
||||
- uses: actions/setup-node@v7.1.0
|
||||
with:
|
||||
node-version: 20
|
||||
- name: Versions agree
|
||||
@@ -82,8 +82,8 @@ jobs:
|
||||
run:
|
||||
working-directory: plan2code-app
|
||||
steps:
|
||||
- uses: actions/checkout@v4.2.2
|
||||
- uses: actions/setup-node@v4.4.0
|
||||
- uses: actions/checkout@v7.0.1
|
||||
- uses: actions/setup-node@v7.1.0
|
||||
with:
|
||||
node-version: 20
|
||||
cache: npm
|
||||
@@ -179,8 +179,8 @@ jobs:
|
||||
matrix:
|
||||
os: [windows-latest, macos-latest, ubuntu-latest]
|
||||
steps:
|
||||
- uses: actions/checkout@v4.2.2
|
||||
- uses: actions/setup-node@v4.4.0
|
||||
- uses: actions/checkout@v7.0.1
|
||||
- uses: actions/setup-node@v7.1.0
|
||||
with:
|
||||
node-version: 20
|
||||
- name: Cache the npm downloads
|
||||
|
||||
@@ -27,8 +27,8 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 20
|
||||
steps:
|
||||
- uses: actions/checkout@v4.2.2
|
||||
- uses: actions/setup-node@v4.4.0
|
||||
- uses: actions/checkout@v7.0.1
|
||||
- uses: actions/setup-node@v7.1.0
|
||||
with:
|
||||
node-version: 20
|
||||
- name: Cache the npm downloads
|
||||
@@ -60,8 +60,8 @@ jobs:
|
||||
run:
|
||||
shell: bash
|
||||
steps:
|
||||
- uses: actions/checkout@v4.2.2
|
||||
- uses: actions/setup-node@v4.4.0
|
||||
- uses: actions/checkout@v7.0.1
|
||||
- uses: actions/setup-node@v7.1.0
|
||||
with:
|
||||
node-version: 20
|
||||
- name: Cache the npm downloads
|
||||
|
||||
@@ -64,10 +64,10 @@ jobs:
|
||||
run:
|
||||
shell: bash
|
||||
steps:
|
||||
- uses: actions/checkout@v4.2.2
|
||||
- uses: actions/checkout@v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
- uses: actions/setup-node@v4.4.0
|
||||
- uses: actions/setup-node@v7.1.0
|
||||
with:
|
||||
node-version: 22
|
||||
cache: npm
|
||||
@@ -121,7 +121,7 @@ jobs:
|
||||
VERSION="$(node -p "require('./plan2code-app/src-tauri/tauri.conf.json').version")"
|
||||
mkdir -p dist
|
||||
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:
|
||||
name: app-${{ matrix.label }}
|
||||
path: dist/*
|
||||
@@ -136,8 +136,8 @@ jobs:
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4.2.2
|
||||
- uses: actions/download-artifact@v4.3.0
|
||||
- uses: actions/checkout@v7.0.1
|
||||
- uses: actions/download-artifact@v8.0.2
|
||||
with:
|
||||
path: dist
|
||||
pattern: app-*
|
||||
|
||||
@@ -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", () => {
|
||||
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 pointer = path.join(home, "console-dir");
|
||||
fs.writeFileSync(path.join(home, "update-check.json"), JSON.stringify({ checkedAt: Date.now(), latest: null }));
|
||||
|
||||
@@ -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 box = await host.boundingBox();
|
||||
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");
|
||||
// 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,
|
||||
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");
|
||||
await gitCard.waitFor();
|
||||
const note = gitCard.locator(".md-host").first();
|
||||
|
||||
@@ -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 page.getByRole("tabpanel").getByText(/in the Save step above/).waitFor();
|
||||
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();
|
||||
assert.ok(changesAt > 0, "the board's column scrolls");
|
||||
// Another tab opens at its own place, not where Changes was left.
|
||||
|
||||
@@ -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 ideas = idOf(s, "Ideas");
|
||||
// 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 until(() => readNotepad(s.project, notes).text === "notes text" && readNotepad(s.project, ideas).text === "", 4000);
|
||||
await typeInto(s, "ideas text");
|
||||
|
||||
@@ -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