orca/mobile/app
Carlos Baraza f534cd5bc3
fix(mobile): downscale oversized clipboard images so paste no longer fails (#5601)
* fix(mobile): downscale oversized clipboard images so paste no longer fails

Pasting a large clipboard image (high-res screenshot or photo) failed with
'Image too large to paste' because the re-encoded PNG exceeded the 24 MiB
base64 upload cap, with nothing shrinking it first.

Now an oversized image is downscaled to fit the budget before upload:
- computeMobileClipboardImageDownscale() picks target dimensions by area
  (~sqrt(budget/actual)), with a bounded retry loop since PNG size is nonlinear.
- prepareMobileClipboardImageBase64() drives the loop with an injected resizer,
  so the byte/dimension logic is unit-tested without native modules.
- The resizer stages the image to a temp file and hands ImageManipulator a
  file:// URI; the iOS native loader (Data(contentsOf:)) cannot decode large
  base64 data URIs, so a data URI made renderAsync throw.

Adds expo-image-manipulator and expo-file-system.

* fix(mobile): fail fast when resized clipboard image has no base64

Empty base64 from saveAsync would pass the downstream base64 check and
upload a corrupt image; throw instead so the paste surfaces an error.

Addresses CodeRabbit review on #5601.

* Fix mobile clipboard image resize cleanup

Co-authored-by: Orca <help@stably.ai>

---------

Co-authored-by: Jinwoo-H <jinwoo0825@gmail.com>
Co-authored-by: Orca <help@stably.ai>
2026-06-18 18:25:06 -07:00
..
h fix(mobile): downscale oversized clipboard images so paste no longer fails (#5601) 2026-06-18 18:25:06 -07:00
_layout.tsx fix(mobile): add terminal link routing setting 2026-06-16 17:05:12 -07:00
about.tsx
browser-settings.tsx fix(mobile): add terminal link routing setting 2026-06-16 17:05:12 -07:00
index.tsx fix(mobile): show usage bars for system-default login (#5499) 2026-06-16 13:29:45 -07:00
notifications.tsx fix(mobile): handle notification permission changes (#1506) 2026-05-06 11:57:42 -07:00
pair-confirm.tsx Mobile: worktree-list sidebar for tablet/foldable layouts (#5505) 2026-06-16 16:50:38 -07:00
pair-scan.tsx Fix mobile Tailnet pairing (#4415) 2026-06-01 17:30:10 -07:00
pair.tsx Add mobile terminal shortcut bar customization (#3012) 2026-05-29 16:39:52 -07:00
settings.tsx fix(mobile): add terminal link routing setting 2026-06-16 17:05:12 -07:00
terminal-settings.tsx Redesign mobile driver overlay layout and clarify action copy (#5647) 2026-06-17 19:21:42 -07:00
troubleshoot.tsx Add braces to mobile control flow (#4351) 2026-05-31 21:32:37 -07:00
voice-settings.tsx feat(mobile): pickers, workspace parity, active-workspace focus, tap-to-open, source-control parity, artifact viewing (#5330) 2026-06-15 22:02:51 -07:00