Show the UPDATE AVAILABLE banner inside the desktop app too, since the app cannot replace itself and a new release still needs plan2code update run in a terminal outside it, and word the modal, Help and docs for that

AI Assisted
This commit is contained in:
jparkerweb committed 2026-11-10 10:19:33 -08:00
1 parent 6e84e6a6a4
commit 8efa1aece1
8 files changed
+65 -37

No files matched your search

+10 -6
View File
@@ -466,10 +466,10 @@ test("the update banner shows on the dashboard only, and its dismiss hides it",
await banner.waitFor({ state: "hidden" });
});
// Under the desktop app (PLAN2CODE_IN_APP=1) the app's own top bar already
// nags about a skills/app mismatch and updates in one click, so this banner
// (a copy-pasted shell command) must never show there, newer release or not.
test("under the app, the update banner never shows", async (t) => {
// Under the desktop app (PLAN2CODE_IN_APP=1) the banner shows too: the app
// cannot replace itself, so a new release is a terminal command there as well,
// and the modal says to run it outside the app and reopen the app.
test("under the app, the update banner shows and its steps are worded for the app", async (t) => {
aNewerReleaseExists(t);
const dash = await openSession(await suite.browser(), {
t,
@@ -479,8 +479,12 @@ test("under the app, the update banner never shows", async (t) => {
env: { PLAN2CODE_IN_APP: "1" },
});
const main = await toTheMenu(dash);
await main.getByText("One spec on disk, with a plan drafted.").waitFor();
assert.equal(await main.getByText("UPDATE AVAILABLE").count(), 0, "no banner under the app");
await main.getByRole("button", { name: /UPDATE AVAILABLE · v99\.0\.0/ }).click();
const modal = dash.page.locator("#update-modal");
await modal.waitFor();
await modal.getByText("a terminal outside the app", { exact: false }).waitFor();
await modal.getByText("close the app and open it again", { exact: false }).waitFor();
assert.equal(await modal.locator("#update-command code").textContent(), "plan2code update");
});
// Same reasoning for the dashboard's own red-meter banner: under the app it
+6 -6
View File
@@ -300,10 +300,9 @@ test("the update banner opens a modal with the exact update commands, and its di
assert.equal(await main.getByRole("button", { name: /UPDATE AVAILABLE/ }).count(), 0, "the banner came back after a reload");
});
// Under the app the dashboard's own UPDATE AVAILABLE banner never shows (a
// separate test already covers that), so Help's own line about it must not
// send an in-app reader to a terminal command for a banner they can never see.
test("under the app, Help's update line points at Update skills, not the dashboard banner's terminal command", async (t) => {
// Under the app Help's update line names both notices, says the command runs
// outside the app with a reopen after, and keeps Update skills for a mismatch.
test("under the app, Help's update line says to run the command outside the app and keeps Update skills for a mismatch", async (t) => {
savedLooks(t, { welcomeSeen: true });
const s = await openSession(await suite.browser(), {
t,
@@ -317,8 +316,9 @@ test("under the app, Help's update line points at Update skills, not the dashboa
await tabButton(s, "dashboard").click();
const text = s.page.locator("#help-update-text");
await text.getByText("Update skills", { exact: false }).waitFor();
assert.equal(await text.locator("code").count(), 0, "no terminal command under the app");
assert.equal(await text.getByText("UPDATE AVAILABLE", { exact: false }).count(), 0, "no mention of a banner that never shows there");
assert.equal(await text.locator("code").textContent(), "plan2code update");
await text.getByText("outside the app", { exact: false }).waitFor();
assert.equal(await text.getByText("/plan2code", { exact: false }).count(), 0, "no restart through /plan2code under the app");
});
// Under the app, when the console server itself is gone, the live "About"