Skip to content

feat(mobile): redesign the new thread composer with files - #229

Merged
nixuuu merged 1 commit into
feat/mobile-ux-2from
feat/mobile-ux-3
Nov 5, 2026
Merged

nixuuu merged 1 commit into
feat/mobile-ux-2from
feat/mobile-ux-3

Conversation

@nixuuu

@nixuuu nixuuu commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

Stage 3 of 5, mobile UX: the new thread composer with files.

One screen, as on the web

  • The composer has the model, effort and a paperclip.
  • Under it: project, worker and permissions.

Starting values: the project's defaults over Settings → Threads, then the last used values.

Offline worker: sending is held, with "‹worker› is offline. Start it or choose another worker."

Attachments

  • Photos and files go through UploadAttachment, with the gateway's limits. They work in existing threads too.
  • A message with files is always queued.
  • New dependencies: expo-image-picker, expo-document-picker, expo-file-system. They need a new native build.

Checked on the Android emulator, light and dark: new thread, worker picker, offline worker, attachment, created thread.

Copy audit (§8):

  • "Could not start the thread. Check the worker and try again."
  • "Could not upload. Remove it and try again."
  • "Uploading files…"

New thread is one screen like the web composer: the message box with
model, effort and files, and under it the project, worker and
permission pickers. Starting values come from the project's defaults
over Settings → Threads, then what was used last; an offline worker
or missing agent blocks sending with a note. Photos and files upload
as they are picked, within the gateway's limits, also in the thread
composer, where a message with files always queues.
@nixuuu
nixuuu added this pull request to stack #232 November 5, 2026 21:54
@nixuuu
nixuuu marked this pull request as ready for review November 5, 2026 21:55
@nixuuu
nixuuu merged commit 2c727f4 into dev Nov 5, 2026
10 checks passed
@nixuuu
nixuuu deleted the feat/mobile-ux-3 branch November 5, 2026 22:02
nixuuu added a commit that referenced this pull request Nov 8, 2026
Selecting Photos or Files could present a native picker while the
attachment menu's React Native Modal was still closing. `PickerSheet`
called `onClose` and immediately ran the selected action, while
`Overlay` retained its native modal through the exit animation. UIKit
could therefore dismiss the picker and leave the app covered by a modal.

The attachment menu now queues Photos, Files and Paste image until its
dismissal callback: after the exit animation and native
`Modal.onDismiss` on iOS, or removal of the unanimated Android Dialog.
Closing overlays stop accepting touches. A single-launch lock releases
on selection, cancellation, dismissal and errors; picker and clipboard
errors show a short actionable message. No camera attachment action
exists. The native paste/drop module was reviewed and does not own the
competing modal.

Fixes: #229

### Verification

- Android phone, current checkout through a dev client, against an
isolated gateway, scripted worker and Postgres: photo selection and
upload, repeated picks, cancel, denied photo permission followed by
another successful selection, file selection/upload/cancel, menu
dismissal, and Paste image upload. The scripted worker received uploaded
image metadata and dimensions. Light and dark phone layouts checked.
- Fresh local Android dev-client build passes. Repeated photo
selection/cancel/upload, denied photo permission followed by
selection/upload, file selection/upload, clipboard-error recovery and a
fresh clipboard image upload pass on the new binary. A clipboard image
retained across reinstall triggered the error alert; closing it restored
the composer, and copying a new image succeeded.
- iOS: before the fix, an older installed simulator app closed the
attachment menu without leaving a usable photo picker; navigation still
worked, so the complete reported touch freeze was not reproduced.
Fixed-code simulator verification is blocked: the installed dev client
lacks `CanopyPinnedFetch`, and available disk is below the required 12
GB build floor. Reviewed the pinned RN modal implementation and SDK 58
picker documentation. Full-library permission is unnecessary for the
system photo picker.
- iPad/Fold: not verified. The existing Fold was busy; a temporary Fold
could not boot because the device host lacked disk space and was
deleted. Runtime photo/file picker-error and iOS paste-denial alerts
were not induced.
- Gates: dependency installation, generated-code check, root
typecheck/lint/format check, web build, mobile typecheck, Expo lint,
Expo Doctor (20/20), CNG prebuild and both native production bundle
exports pass. Full `check:tmp`: 1,773 passed, 161 skipped, 2 failed
across 318 files; temp cleanup passes. Both unrelated gateway failures
(`bots-harness-regressions.test.ts` and `linked-routes-status.test.ts`)
pass on the focused recheck: 16 passed, zero failed, temp cleanup clean.
The original full run was not clean. No UI test suites added or run.

Device checks and the full test run were completed on `ef3611f2`. The
subsequent merge of current `dev` preserves its keyboard dismissal
before opening the attachment menu; typecheck, lint, formatting and Expo
lint were rerun after resolving that conflict. Device checks were not
repeated after this merge.

### Copy audit (§8)

Previously silent picker/clipboard failures now use:

- “Could not open photos” → “Try again or attach a file.”
- “Could not open files” → “Try again or attach a photo.”
- “Could not paste image” → “Copy the image again, then allow pasting if
asked.”
- Missing clipboard image → “No image was pasted” / “Copy an image and
try again.”

Each alert has a “Close” action. Copy uses sentence case, short
sentences, a problem followed by an action, and existing glossary terms;
no raw errors, duplicate facts, colour-only cues or sentences with
“soul”. Existing Photos/Files labels are unchanged. Phone layouts were
checked with the fixed labels and long generated attachment names,
including the native clipboard-error alert; wide layouts and the other
error alerts remain unverified.
nixuuu added a commit that referenced this pull request Nov 8, 2026
## Change

Mobile's Project picker now shows one “No project” and one choice per
shared project identity, using the same global-id/Git-origin model as
web. Distinct same-name projects show computer/workspace details. Worker
choices have one row per worker and stable computer groups. The sidebar
filter, thread defaults and project settings use the same projection;
settings still edit the original local record.

Two causes were reproduced:

- The standalone Project picker introduced in #229 rendered raw overview
records. Those include a scratch project per computer and configuration
replicas, even when only one computer has the directory.
- Retention introduced in #348 can keep an old peer project after an
aggregate starts representing it through a local alias. Both records can
reference the same remote workspace. The prior projection concatenated
that workspace twice; snapshots/retention also preserved repeated
resource IDs. The critical-state regression failed before the fix and
passes afterward, including preservation of the current aggregate's
workspace metadata.

Shared reconciliation now enforces stable resource IDs, replaces a
home's snapshot atomically and preserves other homes' workspaces. The
shared projection deduplicates workspace and project references. Real
two-gateway coverage replays phone subscriptions through aggregate
snapshots, peer snapshots and compatibility upserts, then checks
original home/workspace selection and routing. Existing owner-scoping
and offline coverage remains intact.

The inspected gateway path serves peer RPCs through local-only handlers
and qualifies home IDs; no A→B→A aggregation was found. This change
requires no gateway update or protocol change. Mobile ships through OTA;
web/desktop reconciliation hardening accompanies the next desktop
update.

## Verification

- 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 run check:tmp --timeout 20000` — 1,822 passed, 161
skipped, 0 failed across 325 files; `check:tmp: nothing left in the temp
dir`.
- Focused checks: 8 state/project-identity tests and 5 linked-project
integration tests passed. Multi-gateway files ran sequentially. Mobile's
`bun run lint` also passed.
- Manual device/browser visual checks were not run. The web edit changes
state reconciliation; mobile reuses the existing picker/settings layout.

## OTA compatibility

Only JS/TS and documentation changed. Native dependencies, app
configuration and protocol descriptors are unchanged. No EAS builds or
APKs were produced.

Ran `bunx [email protected] fingerprint:generate --platform <ios|android>
--build-profile production --json --non-interactive` before editing and
after the final commit. Full fingerprint JSON files compare byte for
byte:

| Platform | Before = after |
| --- | --- |
| iOS | `2a0ef03a2a0fda8e7fad2e3df8609803d2edbda3` |
| Android | `c5c880ae8d0f5d7bc867fcbaf8f756b2ca56a07d` |

## Copy audit (§8)

Before: repeated “No project”/project rows and worker names without
their computer. After: one scratch choice, searchable aliases (“Also
named …”), computer/path details for distinct same-name projects, and
“Worker · Computer” in settings. Missing scratch workspaces use the
existing web instruction: “No scratch directory. Configure this worker.”

Text follows sentence case and the existing glossary, with action verbs
and accessible text cues. No new confirmations, error flows, glossary
terms or humor. Details use existing compact text slots.
Short/typical/long-name rendering at phone and wide widths remains
unverified (§8.9); no visual verification is claimed.

Fixes: #348
Fixes: #229
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