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

+3 -2
View File
@@ -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).
+14 -6
View File
@@ -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.
+1 -3
View File
@@ -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;
+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"
+2 -2
View File
@@ -4174,7 +4174,7 @@
<p class="modal-blurb" id="update-versions"></p>
<ol class="update-steps">
<li>
Run this in your terminal (not in this page or your agent):
<span id="update-step-run">Run this in your terminal (not in this page or your agent):</span>
<div class="update-command" id="update-command"></div>
It updates everything that was installed (the skills, the <code>plan2code</code>
command and any extras you added), with no menu. If the <code>plan2code</code>
@@ -4184,7 +4184,7 @@
could not reach the repository and hid the reason: run
<code>git ls-remote https://github.com/jparkerweb/plan2code.git</code> to see it.
</li>
<li>When it finishes, close this console and start <code>plan2code</code> again.</li>
<li id="update-step-restart">When it finishes, close this console and start <code>plan2code</code> again.</li>
</ol>
<div class="modal-actions">
<button type="button" class="btn primary" id="update-done">Close</button>
+16 -4
View File
@@ -143,6 +143,16 @@ function openUpdateModal() {
const fallbackRow = $("update-fallback");
const fallback = el("code", null, UPDATE_FALLBACK_COMMAND);
fallbackRow.replaceChildren(fallback, copyButton(UPDATE_FALLBACK_COMMAND, "btn small ghost handoff-copy", fallback));
// Under the app, its terminal panel runs the agent, and the app it would
// update is the one running this page.
$("update-step-run").textContent = page.inApp
? "Run this in a terminal outside the app (not in its terminal panel, which runs your agent):"
: "Run this in your terminal (not in this page or your agent):";
$("update-step-restart").replaceChildren(
...(page.inApp
? ["When it finishes, close the app and open it again."]
: ["When it finishes, close this console and start ", el("code", null, "plan2code"), " again."])
);
$("update-modal").showModal();
}
@@ -164,10 +174,12 @@ export function renderDashboard(main) {
warn.setAttribute("role", "status");
wrap.appendChild(warn);
}
// Built here only, so no other workflow's page ever shows it. Under the app
// this never shows at all: the app's own top bar already says so and, unlike
// this banner's copy-pasted command, updates the skills itself in one click.
if (page.updateFrame && !page.inApp && !updateDismissed()) {
// Built here only, so no other workflow's page ever shows it. It shows under
// the app too, beside the app bar's own "Update available": the app cannot
// replace itself, so a new release is the same terminal command either way
// (the bar's one-click Update skills only levels skills to the app's own
// version), and the modal words its steps for the app.
if (page.updateFrame && !updateDismissed()) {
const notice = el("div", "dash-nudge update-banner");
notice.setAttribute("role", "status");
const open = el("button", "update-banner-open", "UPDATE AVAILABLE · v" + page.updateFrame.latest);
+13 -8
View File
@@ -67,18 +67,23 @@ function renderAbout() {
}
}
// Under the app, the dashboard's own UPDATE AVAILABLE banner never shows (the
// app's bar already nags about a skills/app mismatch and updates in one
// click, see docs/desktop-app.md), so this line would describe a banner the
// reader can never find and send them to a terminal the app's own button
// already makes unnecessary. Patched once, the first time Help opens, since
// page.inApp never changes for the session's life.
// Under the app, a new release still needs a terminal (the app cannot replace
// itself), but not the terminal panel, and the restart is the app's, not a
// new /plan2code; a skills/app mismatch is the bar's one-click Update
// skills (see docs/desktop-app.md). Patched once, the first time Help opens,
// since page.inApp never changes for the session's life.
function renderUpdateHelp() {
if (!page.inApp) return;
$("help-update-text").replaceChildren(
"When the app and the installed skills fall out of step, its own top bar says so and offers ",
"When a newer Plan2Code release is out, the dashboard shows ",
el("strong", null, "UPDATE AVAILABLE"),
" at the top and the app's top bar shows ",
el("strong", null, "Update available"),
". Both give you the same command, ",
el("code", null, "plan2code update"),
": run it in a terminal outside the app (not its terminal panel), then close the app and open it again. The app cannot replace itself while it runs, so a new release has no one-click update. When the app and the installed skills fall out of step, the bar offers ",
el("strong", null, "Update skills"),
", which brings them level in one click, no terminal needed."
" instead, which brings them level in one click."
);
}