Repository navigation
feat(mobile): redesign the new thread composer with files - #229
Merged
Merged
Conversation
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
marked this pull request as ready for review
November 5, 2026 21:55
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
This was referenced Nov 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stage 3 of 5, mobile UX: the new thread composer with files.
One screen, as on the web
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
UploadAttachment, with the gateway's limits. They work in existing threads too.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):