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

+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."
);
}