Skip to content

Updates 3/3: review-window notice from the server, the 3-day toast, Pi parity - #1835

Merged
backnotprop merged 2 commits into
mainfrom
feat/updates-review
Oct 11, 2026
Merged

backnotprop merged 2 commits into
mainfrom
feat/updates-review

Conversation

@backnotprop

Copy link
Copy Markdown
Owner

Part 3 of 3 of the owner-approved update notices (design .product/approved/plannotator-updates/). Stacked on #1833 (Inbox), which is stacked on #1830 (the check).

What it does

The browser no longer asks GitHub. useUpdateCheck lost its per-page-load fetch of releases/latest (no throttle, no off switch, and in remote mode a remote browser leaking Origin: http://localhost:<port> to GitHub). It now takes the server's advert; ?preview-update=X still simulates one.

Servers advertise the answer (cache only, never a network call on a page load):

  • Bun (compiled CLI): /api/plan and /api/diff carry updateAvailable: { version, current, releaseUrl, action, command } (getUpdateAdvert(origin)). action: script (the binary the install script manages), copy (an unmanaged binary), opencode (OpenCode-launched CLI). command carries the remembered install flags, so a pasted command no longer resets install-flags.json.
  • Pi (node servers, parity): the same field with action: "pi", command: "pi update --extensions" (was the wrong pi install npm:…), compared with the Pi package's own version; the Pi extension also schedules the shared daily check (vendored update-check). Nothing for oh-my-pi.
  • POST /api/update (Bun plan/review/annotate): the toast's and menu's Update, the same startManualUpdate wrapper and update.lock as the Inbox; same-origin only.

The toast (useUpdateToast): at most once per version and at most once every 3 days across versions (owner's answer 3; cookie shared by every localhost port), first look 5 s after load, queued behind every first-run dialog of the load and never while a composer or dialog has focus (re-checks, unconsumed), never for share links / archive / server-less pages / while auto-update is active. Copy per host from the design; actions What's new · Update (script) or Copy command.

Options menu: the dot stays, the label shimmer is gone (no motion); the version section shows "X is available · What's new", the host's command with Copy, and Update now for script.

Settings → General: "Tell me when a new version is out" (updateCheck, the off switch, owner's answer 1) above "Keep Plannotator up to date", which is locked with "Needs update checks" while checks are off.

Tests

  • packages/ui/utils/updateNotice.test.ts: the 3-day / once-per-version rhythm, advert validation, per-host toast copy (Pi never gets the install script).
  • packages/server/update-advert.test.ts: the advert on plan / annotate / review payloads, absent when checks are off (config or env), up to date, or outside the compiled CLI; host action; POST /api/update refuses cross-origin, dev builds, unmanaged binaries, and a second run under update.lock.
  • apps/pi-extension/update-advert.test.ts: the Pi mirror.
  • packages/ui/components/MenuVersionSection.test.tsx (DOM): command per host, Update now only for script.

Known gap (design phase 3, not built): OpenCode's in-process embedded plan server sends no advert (it has no version to compare); OpenCode's review/annotate run the CLI and do.

@backnotprop
backnotprop changed the base branch from feat/updates-inbox to main October 11, 2026 00:28
@backnotprop
backnotprop force-pushed the feat/updates-review branch 2 times, most recently from 171fdea to b003252 Compare October 11, 2026 01:23
…oast, Pi parity

The browser no longer asks GitHub on every page load. The compiled CLI's plan,
review and annotate servers (and Pi's three servers) put updateAvailable on
the payload from the machine's once-a-day cache, with the action and command
for the host (install command with remembered flags; pi update --extensions
on Pi). The toast shows at most once per version and once every three days,
behind the first-run dialogs and never over a focused composer; its Update
runs POST /api/update (the same install wrapper, once). The Options menu keeps
the dot without the shimmer and shows the right command; Settings gains the
update-notice switch.
…bs get 409, the guides.show viewer unchanged

- POST /api/update refuses any Host that is not loopback with this server's
  port, refuses a remote-mode or --tailscale session outright, and their
  advert says copy (the command), so a LAN or tailnet device can never start
  the installer. The client sends its serverSession; another session's tab
  gets 409 session_mismatch.
- The update-notice switch is no longer a settings-registry entry
  (useUpdateCheckSetting writes POST /api/config), so the pinned guides.show
  viewer build is byte-identical: build:viewer then check:manifest is in sync.
- Docs: never the browser, Pi as a caller, the review-window notice.
@backnotprop
backnotprop merged commit c1cd23a into main Oct 11, 2026
30 checks passed
@backnotprop
backnotprop deleted the feat/updates-review branch October 11, 2026 02:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant