Skip to content

fix(mobile): keep the app usable after picking a photo - #355

Merged
nixuuu merged 2 commits into
devfrom
fix/mobile-photo-picker-freeze
Nov 8, 2026
Merged

nixuuu merged 2 commits into
devfrom
fix/mobile-photo-picker-freeze

Conversation

@nixuuu

@nixuuu nixuuu commented Nov 8, 2026 •

Copy link
Copy Markdown
Member

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.

Wait for attachment menu animation and native modal dismissal before launching Photos, Files or Paste image. Disable closing overlays and unlock attachment actions on cancellation and errors.

Fixes: #229
# Conflicts:
#	apps/mobile/src/features/attachments/Attachments.tsx
@nixuuu
nixuuu marked this pull request as ready for review November 8, 2026 09:32
@nixuuu
nixuuu merged commit 2ea8ed5 into dev Nov 8, 2026
11 checks passed
@nixuuu
nixuuu deleted the fix/mobile-photo-picker-freeze branch November 8, 2026 09:37
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