From 8efa1aece1fe0e673b859d630156b3f0faa45792 Mon Sep 17 00:00:00 2001 From: Justin Parker Date: Tue, 10 Nov 2026 10:19:33 -0800 Subject: [PATCH] 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 --- README.md | 5 +++-- docs/desktop-app.md | 20 ++++++++++++------ install.js | 4 +--- scripts/test-web-console-page-dashboard.mjs | 16 ++++++++------ scripts/test-web-console-page-help.mjs | 12 +++++------ src/web-console/public/index.html | 4 ++-- src/web-console/public/screens/dashboard.js | 20 ++++++++++++++---- src/web-console/public/screens/help-dialog.js | 21 ++++++++++++------- 8 files changed, 65 insertions(+), 37 deletions(-) diff --git a/README.md b/README.md index 823193b..14394ce 100644 --- a/README.md +++ b/README.md @@ -131,8 +131,9 @@ one on a brief built from the session, and the console's own Session meter point session is getting long. Once it is installed, `plan2code` opens the app instead of running the agent in your terminal. `plan2code --classic` keeps the terminal flow, and so does a Linux machine with no display (over SSH, say) or any machine over an SSH session. `plan2code update` updates the skills, the -command and the app together, and the bar offers the same **Update skills** when the app and the -installed skills disagree. `plan2code uninstall` removes all three. +command and the app together; run it in a terminal outside the app when the bar says **Update +available**, then reopen the app. The bar also offers **Update skills** when the app and the installed +skills disagree. `plan2code uninstall` removes all three. The app can also build a whole spec unattended with the Implementation Loop; see [docs/desktop-app.md](docs/desktop-app.md#implementation-loop). diff --git a/docs/desktop-app.md b/docs/desktop-app.md index f756178..40e0993 100644 --- a/docs/desktop-app.md +++ b/docs/desktop-app.md @@ -121,9 +121,9 @@ to that offers the same **Reconnect the console** button — never "Restart the The console also knows when it is running inside the app (the agent it talks to carries that signal): its session meter, the "Before you close this" guide on a finished step, and the dashboard's red-session banner all point at the app's own **New Session** button instead of a command to paste into a new -conversation, since New Session already does that in one click; and the console's own "update available" -banner never shows, since the app's **Update skills** button (below) already covers it with no shell -involved. A slash command still offered to continue a step (such as `/plan2code-4-finalize`) stays +conversation, since New Session already does that in one click. The dashboard's **UPDATE AVAILABLE** +banner still shows, beside the bar's own **Update available**, and its steps say to run the command in a +terminal outside the app and then reopen the app (see "Keep it up to date" below). A slash command still offered to continue a step (such as `/plan2code-4-finalize`) stays exactly as it would in a terminal: paste it into the app's own terminal panel, which runs the real agent CLI. @@ -248,9 +248,17 @@ clean tree. The in-app **Help** has a matching topic, **Implementation Loop**, w ## Keep it up to date -`plan2code update` brings the skills, the `plan2code` command and the app up together. If the app -and the installed skills ever differ in version, the app's top bar says so and offers **Update -skills**, which runs that same update when you press it. It never updates on its own. +`plan2code update` brings the skills, the `plan2code` command and the app up together. + +When a newer release is out, the app's top bar shows **Update available** with **Copy update command**, +and the dashboard shows its **UPDATE AVAILABLE** banner. Neither updates for you: the app cannot replace +itself while it runs (Windows will not overwrite a running file), so copy the command, run it in a +terminal outside the app (not the app's terminal panel, which runs your agent), then close the app and +open it again. + +If the app and the installed skills ever differ in version, the app's top bar says so and offers **Update +skills**, which brings the skills level with the app's own version when you press it. That one is a +single click, because it never has to replace the app. Nothing updates on its own. To remove the app along with the skills and the command, run `plan2code uninstall`. It asks first, then asks whether your own data in `~/.plan2code/` (notebooks, handoffs, settings) goes too. diff --git a/install.js b/install.js index 18335cd..9fedea4 100644 --- a/install.js +++ b/install.js @@ -2902,9 +2902,7 @@ async function installDesktopApp({ quiet = false, unattended = false, outcome = return fail(`the file was verified but could not be put in ${APP_DIR} (${error.message}); close the app and try again.`); } recordInstalled('app'); - console.log(` ${COLORS.GREEN}${SYMBOLS.SUCCESS}${COLORS.RESET} Installed: ${APP_DEST}`); - console.log(` ${COLORS.YELLOW}${SYMBOLS.WARNING}${COLORS.RESET} The app is unsigned, and it starts the agent with permission checks off.`); - console.log(` ${COLORS.YELLOW}${SYMBOLS.WARNING}${COLORS.RESET} See docs/desktop-app.md for how to allow it on macOS and Windows if needed.`); + console.log(` ${COLORS.YELLOW}${SYMBOLS.INFO}${COLORS.RESET} The app is unsigned, if need see docs/desktop-app.md for how to allow it.`); console.log(''); outcome.app = true; return 0; diff --git a/scripts/test-web-console-page-dashboard.mjs b/scripts/test-web-console-page-dashboard.mjs index 357574e..e4edd5c 100644 --- a/scripts/test-web-console-page-dashboard.mjs +++ b/scripts/test-web-console-page-dashboard.mjs @@ -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 diff --git a/scripts/test-web-console-page-help.mjs b/scripts/test-web-console-page-help.mjs index 0784382..1334191 100644 --- a/scripts/test-web-console-page-help.mjs +++ b/scripts/test-web-console-page-help.mjs @@ -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" diff --git a/src/web-console/public/index.html b/src/web-console/public/index.html index b6b426e..159676a 100644 --- a/src/web-console/public/index.html +++ b/src/web-console/public/index.html @@ -4174,7 +4174,7 @@
  1. - Run this in your terminal (not in this page or your agent): + Run this in your terminal (not in this page or your agent):
    It updates everything that was installed (the skills, the plan2code command and any extras you added), with no menu. If the plan2code @@ -4184,7 +4184,7 @@ could not reach the repository and hid the reason: run git ls-remote https://github.com/jparkerweb/plan2code.git to see it.
  2. -
  3. When it finishes, close this console and start plan2code again.
  4. +
  5. When it finishes, close this console and start plan2code again.