Skip to content

feat(mobile): add the update center - #371

Merged
nixuuu merged 1 commit into
feat/update-announce-2from
feat/update-announce-3
Nov 8, 2026
Merged

nixuuu merged 1 commit into
feat/update-announce-2from
feat/update-announce-3

Conversation

@nixuuu

@nixuuu nixuuu commented Nov 8, 2026 •

Copy link
Copy Markdown
Member

Change

Add the mobile Updates sheet at the third sidebar footer action, matching web's entry point. It shows the gateway or desktop app, linked computers, workers grouped by computer, update-run steps, agent CLIs and the phone's OTA status. A fixed-position dot marks available or running updates.

The sheet and Settings → Workers share rows and action gates. Existing owner-scoped gateway APIs handle check, update, retry, CLI installation and Update all; bulk updates retain the gateway's existing scope. Polling pauses in the background and retains the last snapshot during restarts. Raw errors have Show details and Copy details. Older in-flight snapshots cannot restore a pending departure after its success event.

Verification

  • Real-TLS mobile route integration passed: 12 tests, 45 assertions, including late responses after a terminal update event and no RPC replay.
  • Install, generated-code check, full typecheck, lint, formatting, web build and the final full bun run check:tmp passed on the stack: 1837 pass, 161 skip, 0 fail across 326 files; no test-owned temp entries remained. Opt-in live tests were skipped.
  • Web gallery viewed in light/dark at desktop/phone widths with long text and rollback. Native mobile sheet/OTA behavior and iOS/Android layout were not exercised on a device. No UI tests, native changes, builds or dependencies were added.

Copy audit — docs/copy.md §8: raw phase values and scattered update settings → compact named states, version → target, labelled Update actions and one update center. Errors state what happened and name retry/reload; raw messages are behind Show details with Copy details. Sentence case, short active instructions, glossary, imperative labels, nonempty sections, no duplicate facts, no humour, accessible status words and fixed action space checked. Native visual review with short/typical/long text remains pending device verification.

Mobile runtime fingerprint: EAS CLI 27.4.1, production, before → after the stack: iOS 2a0ef03a2a0fda8e7fad2e3df8609803d2edbda3 → identical; Android c5c880ae8d0f5d7bc867fcbaf8f756b2ca56a07d → identical. The mobile changes can ship through OTA with the existing runtime.

Device follow-up: open Updates from the sidebar in light/dark, check long computer/worker names and versions, expand CLI/details/run sections, and compare actions with web. Then update the gateway from another device to check the announcement, persistent reconnect and terminal outcome.

@nixuuu
nixuuu added this pull request to stack #372 November 8, 2026 20:25
@nixuuu
nixuuu force-pushed the feat/update-announce-3 branch from bf2fceb to b7530ed Compare November 8, 2026 20:26
@nixuuu
nixuuu marked this pull request as ready for review November 8, 2026 20:40
@nixuuu
nixuuu merged commit 996e976 into dev Nov 8, 2026
11 checks passed
@nixuuu
nixuuu deleted the feat/update-announce-3 branch November 8, 2026 20:42
nixuuu added a commit that referenced this pull request Nov 8, 2026
Background refreshes changed a successful peer snapshot from fresh to
stale and back on every poll. The waiting message became a transient
disclosure on mobile and a changing status line on web. Keep the cached
snapshot fresh during refreshes; failed reads still expose stale status
and retain details.

Manual checks from mobile and web now reach the desktop app that owns
the gateway through the existing app-control channel. Linked checks use
the same path at their home. Requests coalesce, have a 10-second
cooldown, and wait up to 30 seconds for a newer completed check report.
Older desktops receive the existing check command without waiting for
unsupported fields. Owner checks remain enforced; checking the app does
not grant permission to replace gateway binaries.

Canopy rows show the app's actual check time, including the phone's OTA
check time. Older apps show `Check time unavailable`. Browser clients of
a desktop gateway also show its local app row.

Validation:
- `bun install`, `bun run gen:check`, `bun run typecheck`, `bun run
lint`, `bun run format:check`, `bun run check:tmp`, and the web build.
- Focused peer-cache regression coverage plus linked update/control and
timeout integration checks, one test file at a time. Includes completion
waiting, throttling, older desktops, non-admin owner checks, and
rejection of an unlinked owner.
- Browser review on an isolated port: light/dark, desktop/phone widths,
short/typical/long names, downloaded/error/offline states and check
timestamps. No UI test suites added.
- EAS CLI 27.4.1 production fingerprint generation before/after for both
platforms: iOS `2a0ef03a2a0fda8e7fad2e3df8609803d2edbda3`, Android
`c5c880ae8d0f5d7bc867fcbaf8f756b2ca56a07d`; unchanged. Mobile edits are
JS/TS only. No native builds or publication.

Copy audit (`docs/copy.md` §8):
- Missing freshness information → `Checked {time}` / `Check time
unavailable`; short sentence-case labels distinguish app checks from
gateway polling.
- Browser omission → `Canopy on this computer`; uses the existing
product and computer terms. Local update guidance uses the existing
compact information control.
- No new errors, confirmations, jargon, repeated facts, or humor.
Existing action names remain verbs. Checked labels and long names at
desktop and phone widths; meaning remains visible without color or icon
shape.

The stale/fresh flip originates in #348; #369–#371 expose or share the
affected data. The local manual-check omission predates them. Release
publishing scripts/workflows and the frozen update protocol are
unchanged. Signed macOS installation/restart remains outside this
check-only verification.

Fixes: #348

Related: #369, #370, #371
nixuuu added a commit that referenced this pull request Nov 9, 2026
Updates and every mobile sheet can now be dragged down from their
grabber or header. The shared surface enters, settles and exits by
position only; only the backdrop fades. Compact pickers, confirmations
and full-height forms share the same spring and dismissal lifecycle on
iOS and Android, including wide-window cards.

The gesture follows downward travel 1:1, adds diminishing upward
resistance, and dismisses after 28% of the measured height or a downward
fling of at least 900 dp/s after 8 dp. It preserves release velocity,
returns interrupted/short drags, and prevents a late touch event from
overwriting an exit. Shared close buttons, backdrop taps, accessibility
actions and Android back finish the exit before notifying a parent that
may unmount the sheet. The first drag with an open keyboard dismisses
the keyboard; another drag moves the sheet. Reduced motion makes
automatic positioning instant.

Coverage: `Overlay`, `PickerSheet` (models, effort, permissions,
projects, workers, thread actions and attachment menus), confirmations,
Updates, connection/update details, goal/side-thread/queued-message
forms, and all `SheetSurface` forms/details. Full-screen image/text/file
viewers retain their own viewer behavior.

### Scope and limitations

- JS/TS only. No dependencies, app config, native modules, generated
native projects or runtime policies changed. No app build, OTA
publication, device/simulator run or UI tests.
- Content scroll views keep native scrolling. With the installed
modules, PanResponder cannot reliably take over an active native
ScrollView at offset zero on both platforms without responder conflicts
or a jump. Dragging is deliberately limited to the grabber and marked
header areas.
- PanResponder delivers touch events on JS. Gesture math, shared values,
styles and springs run on the UI thread without React renders per move.
No device FPS measurements were possible; a blocked JS thread can still
delay touch delivery.

### Validation

- Passed: `bun install`, `bun run gen:check`, `bun run typecheck`, `bun
run lint`, `bun run format:check`, and `bun run --filter @canopy/web
build`.
- Passed: `bun test tests/integration/mobile-sheet-gesture.test.ts` — 3
focused math tests, 27 assertions, covering dismissal distance/velocity,
the rubber-band curve and re-grabbing without a position jump.
- Passed: Expo ESLint over every changed mobile file. The additional
whole-app Expo lint reports existing hook-rule violations in untouched
attachment, settings and state files; they are outside this change.
- Full-suite results are not clean locally; the unstable baseline
failures and clean targeted reruns are recorded below. No gateway,
worker, package or existing test code changed.

### Unstable baseline tests on the shared host

This machine is shared by several agents. Timing-sensitive integration
tests failed under concurrent load (host load exceeded 60). The files
below are unchanged by this feature, and every affected file passed a
targeted rerun. These reruns support the load-related explanation but do
not establish a clean full-suite result. Per maintainer authorization,
CI on isolated runners is the full-suite gate for this PR.

| Full-suite attempt | Observed result |
| --- | --- |
| `bun run check:tmp` | 1904 passed, 161 skipped, 13 failed, 3 errors;
2078 tests across 343 files, 1693.25 s. |
| `bun run check:tmp --timeout 30000` | 1916 passed, 161 skipped, 1
failed; 2078 tests across 343 files, 1241.66 s. All failures from the
first run passed; only the shell Stop RPC failed. |
| Third full attempt with `--timeout 30000` | The same shell Stop RPC
failure recurred. Stopped after 629 passing cases because the run was
far from completion, following authorization to avoid more full runs.
Only the owned checker received SIGTERM; it forwarded shutdown and
exited 143 after cleanup. This attempt is incomplete. |

All three attempts reported `check:tmp: nothing left in the temp dir`.
No further full runs were started.

Affected files are under `tests/integration/`:

| File | Observed full-suite errors |
| --- | --- |
| `agent-plugins.test.ts` | Tag reassignment/reinstall exceeded the
default 5000 ms test timeout. |
| `agent-skill-sources.test.ts` | Periodic updates and
catalog/subpath/reference discovery exceeded 5000 ms; timed-out teardown
also reported `Fixture git failed: push` and asynchronous errors. |
| `agent-skills-files.test.ts` | Large concurrent drift-report case
exceeded the 5000 ms timeout. |
| `bots-harness-regressions.test.ts` | Claude routine/wakeup exceeded
the 5000 ms timeout. |
| `bots-harness.test.ts` | Grok missing-session/history retry exceeded
the 5000 ms timeout. |
| `config-sync-projects.test.ts` | Aliased project routing returned gRPC
unavailable for the fixture peer; policy propagation failed its 20 s
eventual assertion. |
| `linked-timeouts.test.ts` | Local read took 511.55 ms against a <500
ms assertion; half-open recovery returned missing updates (`undefined`);
stale-read recovery failed a 20 s eventual assertion; BFF request-slot
scenario did not observe the expected peer request. |
| `thread-mirror-deltas.test.ts` | Gap/epoch full/background recovery
failed its 20 s cursor-convergence assertion. It passed in the second
full run. |
| `composer-shell.test.ts` | “Stop during a shell steer kills its group
and persists the failed delivery” returned `ConnectError [canceled] The
operation was aborted.` around the 10.1 s RPC deadline in attempts two
and three. It passed in attempt one. |

Clean targeted reruns (all using `bun run check:tmp --timeout 30000`):

1. The seven files from `agent-plugins.test.ts` through
`linked-timeouts.test.ts` listed above: **80 passed, 0 failed, 6591
assertions**, 221.49 s.
2. `tests/integration/composer-shell.test.ts`: **17 passed, 0 failed, 72
assertions**, 14.94 s.
3. `tests/integration/thread-mirror-deltas.test.ts`: **12 passed, 0
failed, 88 assertions**, 22.71 s.

Every targeted rerun also confirmed the temporary directory was clean.
The current isolated rerun has finished; no test run remains active.

Fingerprint command, run before and after for both platforms from
`apps/mobile`:
`bunx [email protected] fingerprint:generate --platform <ios|android>
--build-profile production --json --non-interactive`

| Platform | Before | After |
| --- | --- | --- |
| iOS | `2a0ef03a2a0fda8e7fad2e3df8609803d2edbda3` |
`2a0ef03a2a0fda8e7fad2e3df8609803d2edbda3` |
| Android | `c5c880ae8d0f5d7bc867fcbaf8f756b2ca56a07d` |
`c5c880ae8d0f5d7bc867fcbaf8f756b2ca56a07d` |

### Manual checks required on iOS and Android

These are not performed: the installed clients cannot run this checkout.
Check both light/dark themes, phone width and a wide/foldable window.

1. Open Updates, then close separately with ✕, backdrop tap and Android
back. Reopen repeatedly. The surface must remain opaque, slide fully
below the screen edge, and dim/undim only the backdrop. Check the same
behavior in model/effort/project/permissions pickers, attachment menus,
thread actions, connection details and a full thread/bot details sheet.
Use short and long titles; check safe areas, rounded corners and seams.
2. Drag both grabber and header slowly. Release below and above 28% of
the sheet height; try a short downward fling. Short drags spring back;
long drags/flings continue down with finger velocity. Drag upward,
reverse direction and grab again during spring-back. Check resistance,
continuous position, backdrop tracking, cancellation and Android back
while a drag is active. Content must still scroll normally at every
offset.
3. Open searchable model choices and the goal/queued-message forms,
focus an input and type. The sheet must stay above its own keyboard.
Drag once to close only the keyboard, release, then drag again to close
the sheet. Return to the composer and verify draft, choices, typing and
interactive keyboard behavior remain intact.
4. Choose an attachment action that opens the photo library/document
picker. Verify the native picker opens once, after the menu has
disappeared. Check Updates → Open update settings and thread actions →
Rename/Goal likewise. Rotate/fold with a sheet open and verify it
remains reachable.
5. With VoiceOver/TalkBack, activate the grabber's Close action and
existing close controls; test the accessibility escape gesture where
supported. Enable reduced motion and repeat opening, closing, dragging
and spring-back: no automatic spring/slide should play, and dragging
must still work. Inspect interaction smoothness on 60/120 Hz hardware.

### Copy audit (`docs/copy.md` §8)

Before: a decorative, unlabeled grabber. After: button label/action
`Close`, with hint `Drag down to close.` The action starts with a verb;
the hint has four words, sentence case and a period. The control has a
spoken action and does not rely on its shape or position. Existing
contextual close labels remain unchanged. No new errors, statuses,
glossary terms or decorative text. The new fixed strings cannot
truncate; surrounding short/long titles retain existing wrapping rules.
Device checks of VoiceOver/TalkBack and visual layout are pending as
described above.

Related: #371
nixuuu added a commit that referenced this pull request Nov 21, 2026
## Changes

The mobile Updates sheet uses the gateway's update plan for its count,
sidebar indicator, and Update all action. When the gateway rejects an
empty plan, the phone reloads the snapshot and shows the current state.
In Workers settings, Show update progress opens the sheet for the
current run.

A paired desktop row gets its state and update action from the desktop
control channel. An up-to-date app stays current when its worker
disconnects. A downloaded app update remains actionable when the feed
omits the target version.

Fixes: #371

## Verification

- All 12 tests in `tests/integration/update-center.test.ts` passed
through `bun run check:tmp`. Coverage includes remote desktop and binary
worker updates, plus an empty Canopy plan with manual updates and an
installable agent CLI.
- Mobile typecheck, edited-file lint, and diff checks passed.
- On an Android emulator with a controlled gateway, verified the current
and downloaded desktop states, the desktop row action, the update count,
the CLI-only state, and recovery when the last installable update
disappeared. Checked the manual-update summary at 320 dp in the dark
theme.
- Native iOS, a real phone OTA, and opening progress from Workers
settings remain unverified. CI handles the full repository gate.

## Copy audit

- “Managed externally” becomes “Up to date” for current paired desktops.
“Manual update” and “Manual updates available” identify releases that
need a separate installer.
- The phone's own update shows “Phone update available” when it is the
only actionable update.
- An empty plan refreshes the sheet and clears the obsolete action. If
the read cannot confirm the empty plan, the gateway's explanation
appears alongside Reload updates. The count, status, and accessible
action names communicate availability without relying on color.
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