Skip to content

feat(updates): show update states at once in a calmer updates popover - #743

Merged
nixuuu merged 2 commits into
devfrom
feat/updates-popover-v2
Nov 14, 2026
Merged

nixuuu merged 2 commits into
devfrom
feat/updates-popover-v2

Conversation

@nixuuu

@nixuuu nixuuu commented Nov 14, 2026

Copy link
Copy Markdown
Member

Summary

Redesign of the sidebar Updates popover and the mobile Updates sheet, following the approved audit. The goal: an immediate state on every click, one summary, rows that never move.

Popover

  • One summary line in the header (Starting update…, Updating · 2 of 5 done, 1 update failed · 4 updated, All 5 updates finished, 5 updates available, Up to date · Checked 5:39 PM). The header divider doubles as the run's 2 px progress bar.
  • Removed from the popover: the progress block, the empty 3-line slot (perf(updates): run independent targets concurrently #700), the active-step list and "Update results". The step history stays in Settings → Workers → Updates.
  • One counter, N of M done. M counts every planned step, including queued ones, so the old "Updating 1" next to "0/2" can't happen. · K failed appears only when K > 0.
  • Footer: a Settings link; What's new only when there are unseen notes; one labelled primary action on the right: Update all, Restart to update, Retry failed, or a disabled Starting… / Updating… with a spinner.
  • Sidebar trigger: arrow-down-tray, with a dot when something waits, a progress ring while updating, and exclamation-circle on failure. No more green check for "downloaded" and no spinning ⟳.

Rows (web UpdateItem, mobile UpdateRow)

  • Always two lines. The badge sits in a fixed slot, the bar in the bottom padding, and the action in a fixed column, so a state change only swaps text (t-swap). Only an error expands, and only on click.

  • One vocabulary from @canopy/domain/release/update-status: Up to date (quiet text), Available, Downloaded (was "Ready"), Queued, Starting, Updating, Waiting, Restarting, Updated (the only green, for 1 h, via UpdateStep.finished_at) and Failed. Edge states keep their own words.

  • Icon actions, one meaning each, with a tooltip and aria-label:

    Icon Action
    arrow-down-tray Update <name>
    power (new) Restart to update
    repeat (new) Retry
    plus Install
    information-circle Details

    arrow-path (⟳) is used only for Check now. There is no cancel glyph, because the API has no cancel action.

  • A feed check no longer turns every row into "Checking".

Immediate states, root cause of the late statuses

  • Before, the UI rendered only server-confirmed state, reload() was blocked while an action was pending, and rows read the targets' own reports, not the run's steps.
  • Now UpdatesState (web) and the mobile state apply an overlay as soon as you click: every planned step shows Queued (plannedUpdateRun, the same plan the gateway writes), a row action shows Starting, and Retry failed marks its steps. The gateway's answer replaces the overlay; an error reverts it.
  • Reads keep running during an action. A row shows the further of its run step and its own report, so it never goes back.
  • Gateway: UpdateCenter.begin() plans, persists and launches the first steps before answering, and the response reuses the planning snapshot. The first answer to Update all already has running steps.

Calm restarts

  • A computer that announced its own update restart shows Restarting with "Restarting to update…".
  • The gateway no longer sets "…is unavailable. Trying again automatically." for it. Its workers and CLIs get "… is restarting to update." instead.
  • After 3 min the row turns amber: "Still restarting after N min. Check that computer." The 35-min step timeout still ends in Failed with Retry.

Gateway / contracts

  • ManageUpdates.retry_failed (action string; proto comment only): re-queues every failed or blocked step of the stopped run in one durable write, keeps successes and their versions, and needs confirm_restart when this app is among them.
  • Additive UpdateStep.finished_at = 12.
  • updatePlan moved into the domain as plannedUpdateRun. computerUpdate() moved from web to @canopy/domain/release/computer-update, so web and mobile derive rows the same way.

Bug fix: this app's "Restart to update" stayed enabled during Update all (CompactAppUpdate.svelte, old line 89). A click restarted this computer mid-run, before the linked computers finished. Row actions are now disabled while a run is active or an action is pending. No Fixes: link: the enable logic dates from #207, and Update all already included this app before #700, so no recent PR introduced it.

Mobile parity: the same summary, rows, icons, overlay, footer and trigger. JS/TS only. bun.lock, the mobile package.json, app config, plugins and native folders are unchanged, so the runtime fingerprint is unchanged and this ships OTA. No EAS was run.

Tests

  • packages/domain/src/release/update-status.test.ts: the shared planner predicts the gateway's steps and their row keys (skipped steps apart, this computer last); rows never go back; Updated stays an hour; the single counter; restart grace.
  • tests/integration/update-concurrency.test.ts: Update all answers with its first steps already running, from the snapshot it planned with; Retry failed re-queues every failed step at once, keeps successes, rejects a stale run id and a second retry.
  • Updated for the new vocabulary and module paths: linked-updates, paired-app-updates, updates-bundled, apps/desktop/test/update-controller.

Checks

bun install · bun run gen:check · bun run typecheck · bun run lint · bun run format:check · the focused tests above (all update suites: update-center, update-concurrency, updates-bundled, stale-app-updates, update-all-computers, paired-app-updates, linked-updates, desktop update-controller, domain) · bun run --filter @canopy/web build · expo export for Android and iOS.

Copy audit (docs/copy.md §8)

Before After Reason
Updates in progress (header) Updating · 2 of 5 done one counted summary replaces 4 places (§2.12)
Updating 1 · 0 done · 0 failed removed merged into the header; zero counts hidden (§5)
Update results · 0/2 (popover) removed duplicate; stays in Settings
Mac-Studio… · Canopy app · Updating removed the row says it
Ready Downloaded says what happened
Updating… (presence badge) Restarting one word for an expected restart; no ellipsis in badges (§2.11)
Waiting for idle Waiting + Restarts after its current turns end. slot width; no jargon (§2.8)
{name} is unavailable. Trying again automatically. (during its own restart) Restarting to update…, after 3 min Still restarting after N min. Check that computer. an expected restart isn't a failure; the warning ends with an action (§2.6)
This Canopy app This computer rows are computers (§3 glossary)
Checked 5:39 PM on every row once: Up to date · Checked 5:39 PM §2.12
Show update progress removed (Updating… while disabled) no-op action
Update details / App updates Settings one link (§5)
What's new always only with unseen notes no empty actions (§5)
tooltip Restart to update Canopy. This stops agents running on this computer. Restart to update. Agents running on this computer stop. one idea per sentence, active voice
Request update again on X Retry verb first, 1–3 words (§4.1)
Installing (CLI) Updating one vocabulary
Agent CLIs · Installing… (mobile) Agent CLIs · 6 · Updating count kept; shared word
— Starting update…, Starting…, Retry failed, 1 update failed · 4 updated, All 5 updates finished -ing + ellipsis for ongoing actions (§4.6); counted results; no exclamation marks

Glossary: computer, worker, agent CLI, update channel; no new terms. No sentences with "soul". Live numbers use tabular-nums and sit at the end of the line. Checked with short, typical and long names (the gallery has "Build server in the rack room · linux-x64 · 64 GB" and "Sleeping computer with a rather long name") at desktop and phone width, light and dark.

Browser review

On the review host: the /dev/updates gallery against a local gateway, captured with Playwright, light + dark, desktop (1100 px) + phone (390 px), in every state. New gallery params: state=quiet, state=starting, restart=1|slow.

States checked: all up to date, available, starting (immediate), updating in parallel with a restarting computer, slow restart, one failed, finished.

  • Found and fixed (second commit): on phones the edge badge "Manual update" was wider than the fixed slot and overlapped the name. The slot is now a minimum width that fits every shared word, so state changes still move nothing; a rare long edge word truncates the name instead.
  • Fixture caveat: in "finished" the gallery leaves some versions unchanged, so those rows correctly show Available again (a newer version beats Updated).
  • Not reviewed: the native mobile sheet on a device. It typechecks and exports for both platforms; no build or EAS was run.

The popover now has one summary line with a single "N of M done" counter
and the header divider as the run's bar. Rows keep two lines with a fixed
badge slot and one icon action (download, power, repeat, plus, info).
Arrow-path is Check now only.

Clicking Update all, Retry failed or a row action shows Queued/Starting
before the gateway answers. Reads keep going while an action is pending.
Rows show the further of their run step and their own report.

The gateway launches the first steps before answering Update all, adds
retry_failed and UpdateStep.finished_at, and no longer calls a computer
that announced its own restart "unavailable". A restart warns only after
3 minutes. This app's restart is disabled while Update all runs.

The planner, status vocabulary and computer rows live in
@canopy/domain, shared by web and the mobile updates sheet.
@nixuuu
nixuuu merged commit f0ab1c5 into dev Nov 14, 2026
11 checks passed
@nixuuu
nixuuu deleted the feat/updates-popover-v2 branch November 14, 2026 18:02
nixuuu added a commit that referenced this pull request Nov 15, 2026
nixuuu added a commit that referenced this pull request Nov 15, 2026
nixuuu added a commit that referenced this pull request Nov 15, 2026
Paired desktop apps in remote gateway mode already support whole-app
updates through `DesktopControlService`. The shared updates row could
still say “Managed externally” or “Offline”, disable its action based on
the worker’s separate UpdateService connection, and show the old
“updates itself” instructions.

Use the desktop control connection and the app’s own newer release for
the row, action, and version target in both the footer popover and
Settings → Workers → Updates. Show “Update Canopy app” when available,
explain how to reconnect or pair when unavailable, and describe
whole-app updates when current. Update all skips disconnected apps with
a reason. The local bundled gateway/worker remain one row, labelled
“This Canopy app”.

Related: #536, #743

Validation passed: `bun install`, `bun run gen:check`, full `bun run
typecheck` (plus a final web typecheck after the copy changes), `bun run
lint`, `bun run format:check`, and the web build. `TMPDIR=/var/tmp nice
-n 10 bun run check:tmp tests/integration/desktop-updates.test.ts
tests/integration/updates.test.ts
tests/integration/update-center.test.ts
tests/integration/updates-bundled.test.ts`: **44 passed, 0 failed,
nothing left in the temp dir**. Full `bun run check:tmp` terminated with
SIGTERM before a final result; it is not counted as passed. This PR
stays draft pending that repository-wide gate.

Browser review passed for the shared popover and Workers updates rows in
light/dark, desktop and phone widths, with short, typical and long
names. Confirmed the enabled “Update Canopy app” action without the
worker update stream, current-version note, visible recovery
instructions, and the single local bundled app row. Used the development
gallery in an isolated review checkout, with only its shell connection
guard bypassed there; no live gateway or native Electron installation
was involved. Removed the review server and checkout afterwards.

Copy audit (§8):
- “Managed by the Canopy desktop app: it updates itself…” → “Updates
with the Canopy app. You can update it here when a new version is
available.” Explains the available remote action.
- “Update {worker name}” → “Update Canopy app”. Names the whole app
being updated.
- “Desktop app is offline.” → “Desktop app is offline. Open Canopy on
that computer and reconnect to this gateway.” Gives a recovery action,
visible below the row.
- Pairing fallback now names this gateway and Settings → App updates for
an already paired older app. Sentences follow length limits, sentence
case, active voice, glossary, and punctuation. No humour, new terms,
colour-only cues, or extra empty states.
- Unsupported-app copy now explains the version limitation and points to
Settings → App updates. “This computer” → “This Canopy app” for the
bundled local row names what updates. Checked wrapping and truncation at
desktop and phone widths.

Native signed macOS installation, notification, and Squirrel restart
require a Mac app run. Integration replaces only the Electron main
updater boundary; it exercises real pairing, worker proof, gateway, TLS
control stream, reports, idle wait, restart/reconnect, and Update all.
nixuuu added a commit that referenced this pull request Nov 15, 2026
## Change

In remote desktop mode, Updates showed the current Canopy app as “This
computer” and its worker as a second computer. Show one row with the
computer's name in both the sidebar popover and Settings → Workers →
Updates.

Match by the enrolled worker ID exposed through the desktop bridge. Keep
local download progress and cached-package restart controls, combine
gateway update-step status and recovery actions, and retain the worker's
agent CLIs. Other workers, including computers with the same name,
remain separate. Older bridges without the ID keep the existing rows.
The change requires a new desktop build.

Related: #743, #771

## Verification

- Passed: web and desktop typechecks; lint and formatting for edited
files; diff review.
- Browser review with development fixtures: light/dark at desktop,
narrow and phone widths; short, typical and long names; downloading,
downloaded, failed and waiting states. Confirmed duplicate names remain
separate, missing identity and web clients keep their workers, cached
updates remain restartable after a request failure, and Update targets
the correct worker.
- Extended desktop runtime integration coverage for enrolled identity
across pairing, restart and unavailable-worker mode. All five tests were
skipped locally because the built runtime was absent.
- Full generation checks, repository-wide checks, tests and selected
builds remain with CI. Native signed desktop installation was not
exercised locally.

## Copy audit

Passed `docs/copy.md` §8. “This computer” plus a repeated worker name →
one computer-name row, removing duplicate information. Moved existing
Update, Retry, Dismiss and restart copy into the combined row; no new
terms or humour. Actions name their effect, failure text gives a
recovery action, and meaning does not depend on colour. Checked
truncation and wrapping with short, typical and long names at desktop
and phone widths in both themes.
nixuuu added a commit that referenced this pull request Nov 21, 2026
nixuuu added a commit that referenced this pull request Nov 21, 2026
## Change

- Report when the gateway is starting or shutting down, even while
GetUpdates can still answer. The Updates panel shows the live phase,
refreshes automatically, and brings update actions back when the gateway
is ready.
- Show the selected version for an active update and only show an
available target when there is a newer release. Refresh after a request
loses a race with startup or shutdown.
- Show binary worker preparation, downloading, restart and reconnection.
Keep the restart visible during the expected disconnect and wait for the
worker to confirm readiness before recording success.

## Verification

- Ran 44 focused tests covering the updater, gRPC lifecycle, durable
update state and bulk scheduling. Re-ran the seven shared status tests
after the final precedence change.
- Generated the protobuf bindings and ran typechecks for gateway,
worker, mobile and web. Checked lint, formatting and the diff for
changed files.
- Exercised the shared web and desktop renderer in Chrome at 390 px and
1280 px, including rejected update requests, automatic refresh and
action recovery.
- Native sheet verification is pending. There is no configured iOS
simulator and the Android emulator host lacks the required build SDK.
- CI owns the repository-wide checks and builds.

## Copy audit

- “Updated” → “Starting” or “Shutting down” when the gateway is
transitioning. The badge and short second line explain when updates
resume.
- “Updating” → “Downloading” while a binary downloads. “Preparing” and
“Reconnecting” identify separate phases with a short explanation in the
row.
- The rejection message now names the gateway transition and says when
to retry. Labels use sentence case and convey state in text. Checked
short and long worker names and both browser widths.

Fixes: #743
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