orca/mobile/src/session
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
..
SessionDockColumn.tsx feat(mobile): combine PR sidebar and checks parity (#5641) 2026-06-17 22:52:12 -07:00
TerminalPaneView.tsx fix(mobile): add terminal link routing setting 2026-06-16 17:05:12 -07:00
github-pr-comment-parsers.ts feat(mobile): combine PR sidebar and checks parity (#5641) 2026-06-17 22:52:12 -07:00
github-pr-mutations.test.ts feat(mobile): combine PR sidebar and checks parity (#5641) 2026-06-17 22:52:12 -07:00
github-pr-mutations.ts feat(mobile): combine PR sidebar and checks parity (#5641) 2026-06-17 22:52:12 -07:00
github-pr-parsers.ts feat(mobile): combine PR sidebar and checks parity (#5641) 2026-06-17 22:52:12 -07:00
github-pr-rpc.test.ts feat(mobile): combine PR sidebar and checks parity (#5641) 2026-06-17 22:52:12 -07:00
github-pr-rpc.ts feat(mobile): combine PR sidebar and checks parity (#5641) 2026-06-17 22:52:12 -07:00
github-pr-value-readers.test.ts feat(mobile): combine PR sidebar and checks parity (#5641) 2026-06-17 22:52:12 -07:00
github-pr-value-readers.ts feat(mobile): combine PR sidebar and checks parity (#5641) 2026-06-17 22:52:12 -07:00
markdown-floating-actions-layout.test.ts Fix mobile markdown actions above keyboard (#4945) 2026-06-08 21:27:33 -07:00
markdown-floating-actions-layout.ts Fix mobile markdown actions above keyboard (#4945) 2026-06-08 21:27:33 -07:00
mobile-artifact-kind.test.ts 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
mobile-artifact-kind.ts 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
mobile-clipboard-image.test.ts fix(mobile): downscale oversized clipboard images so paste no longer fails (#5601) 2026-06-18 18:25:06 -07:00
mobile-clipboard-image.ts fix(mobile): downscale oversized clipboard images so paste no longer fails (#5601) 2026-06-18 18:25:06 -07:00
mobile-diff-comment-edit.test.ts Add mobile Review Changes workflow (#5313) 2026-06-13 14:24:26 -07:00
mobile-diff-comment-edit.ts Add mobile Review Changes workflow (#5313) 2026-06-13 14:24:26 -07:00
mobile-diff-comments.test.ts Add mobile Review Changes workflow (#5313) 2026-06-13 14:24:26 -07:00
mobile-diff-comments.ts Add mobile Review Changes workflow (#5313) 2026-06-13 14:24:26 -07:00
mobile-diff-hunks.test.ts Add mobile Review Changes workflow (#5313) 2026-06-13 14:24:26 -07:00
mobile-diff-hunks.ts Add mobile Review Changes workflow (#5313) 2026-06-13 14:24:26 -07:00
mobile-diff-lines.test.ts
mobile-diff-lines.ts
mobile-diff-review-loaders.ts Add mobile Review Changes workflow (#5313) 2026-06-13 14:24:26 -07:00
mobile-diff-review-queue.test.ts Add mobile Review Changes workflow (#5313) 2026-06-13 14:24:26 -07:00
mobile-diff-review-queue.ts Add mobile Review Changes workflow (#5313) 2026-06-13 14:24:26 -07:00
mobile-diff-review-rpc.ts feat(mobile): combine PR sidebar and checks parity (#5641) 2026-06-17 22:52:12 -07:00
mobile-diff-review-screen-model.test.ts Add mobile Review Changes workflow (#5313) 2026-06-13 14:24:26 -07:00
mobile-diff-review-screen-model.ts Add mobile Review Changes workflow (#5313) 2026-06-13 14:24:26 -07:00
mobile-diff-review-state.test.ts Add mobile Review Changes workflow (#5313) 2026-06-13 14:24:26 -07:00
mobile-diff-review-state.ts Add mobile Review Changes workflow (#5313) 2026-06-13 14:24:26 -07:00
mobile-file-language.ts
mobile-file-syntax.test.ts Fix mobile diff syntax highlighting (#4922) 2026-06-08 17:41:27 -07:00
mobile-file-syntax.ts Fix mobile diff syntax highlighting (#4922) 2026-06-08 17:41:27 -07:00
mobile-image-attachment.test.ts 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
mobile-image-attachment.ts 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
mobile-image-source-picker.test.ts 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
mobile-image-source-picker.ts 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
mobile-markdown-disk-fallback.test.ts Fix file loading on web and mobile remote clients 2026-06-16 14:39:25 -07:00
mobile-markdown-disk-fallback.ts Fix file loading on web and mobile remote clients 2026-06-16 14:39:25 -07:00
mobile-new-tab-agent-options.test.ts
mobile-new-tab-agent-options.ts
mobile-pr-sidebar-resolve.test.ts feat(mobile): combine PR sidebar and checks parity (#5641) 2026-06-17 22:52:12 -07:00
mobile-pr-sidebar-resolve.ts feat(mobile): combine PR sidebar and checks parity (#5641) 2026-06-17 22:52:12 -07:00
mobile-pr-sidebar-state.ts feat(mobile): combine PR sidebar and checks parity (#5641) 2026-06-17 22:52:12 -07:00
mobile-session-create-warning-state.test.ts
mobile-session-create-warning-state.ts
mobile-session-route-helpers.ts Fix rich markdown image paste bloat (#5290) 2026-06-12 16:48:09 -07:00
mobile-session-startup-source.test.ts feat(mobile): combine PR sidebar and checks parity (#5641) 2026-06-17 22:52:12 -07:00
mobile-terminal-records.test.ts Fix remote runtime terminal sharing with mobile (#4901) 2026-06-08 14:26:07 -07:00
mobile-terminal-records.ts Fix remote runtime terminal sharing with mobile (#4901) 2026-06-08 14:26:07 -07:00
opened-mobile-session-tab.test.ts fix(mobile): open the file tab when a terminal file path is tapped 2026-06-17 18:15:53 -07:00
opened-mobile-session-tab.ts fix(mobile): open the file tab when a terminal file path is tapped 2026-06-17 18:15:53 -07:00
optimistic-write-sequence.test.ts feat(mobile): combine PR sidebar and checks parity (#5641) 2026-06-17 22:52:12 -07:00
optimistic-write-sequence.ts feat(mobile): combine PR sidebar and checks parity (#5641) 2026-06-17 22:52:12 -07:00
pr-actions-engine.test.ts feat(mobile): combine PR sidebar and checks parity (#5641) 2026-06-17 22:52:12 -07:00
pr-actions-engine.ts feat(mobile): combine PR sidebar and checks parity (#5641) 2026-06-17 22:52:12 -07:00
pr-ai-triage-launch.test.ts feat(mobile): combine PR sidebar and checks parity (#5641) 2026-06-17 22:52:12 -07:00
pr-ai-triage-launch.ts feat(mobile): combine PR sidebar and checks parity (#5641) 2026-06-17 22:52:12 -07:00
pr-ai-triage-prompt.test.ts feat(mobile): combine PR sidebar and checks parity (#5641) 2026-06-17 22:52:12 -07:00
pr-ai-triage-prompt.ts feat(mobile): combine PR sidebar and checks parity (#5641) 2026-06-17 22:52:12 -07:00
pr-comment-actions.test.ts feat(mobile): combine PR sidebar and checks parity (#5641) 2026-06-17 22:52:12 -07:00
pr-comment-actions.ts feat(mobile): combine PR sidebar and checks parity (#5641) 2026-06-17 22:52:12 -07:00
pr-title-edit.test.ts feat(mobile): combine PR sidebar and checks parity (#5641) 2026-06-17 22:52:12 -07:00
pr-title-edit.ts feat(mobile): combine PR sidebar and checks parity (#5641) 2026-06-17 22:52:12 -07:00
session-panel-host.test.ts feat(mobile): combine PR sidebar and checks parity (#5641) 2026-06-17 22:52:12 -07:00
session-panel-host.ts feat(mobile): combine PR sidebar and checks parity (#5641) 2026-06-17 22:52:12 -07:00
tab-strip-scroll.test.ts Fix active tab scrolling and editor keyboard layout on mobile (#5271) 2026-06-12 11:09:08 -07:00
tab-strip-scroll.ts Fix active tab scrolling and editor keyboard layout on mobile (#5271) 2026-06-12 11:09:08 -07:00
use-mobile-diff-review-comment-actions.ts Add mobile Review Changes workflow (#5313) 2026-06-13 14:24:26 -07:00
use-mobile-diff-review-controller.ts feat(mobile): combine PR sidebar and checks parity (#5641) 2026-06-17 22:52:12 -07:00
use-mobile-diff-review-git-actions.ts Add mobile Review Changes workflow (#5313) 2026-06-13 14:24:26 -07:00
use-mobile-diff-review-interactions.ts Add mobile Review Changes workflow (#5313) 2026-06-13 14:24:26 -07:00
use-mobile-diff-review-send-actions.ts Add mobile Review Changes workflow (#5313) 2026-06-13 14:24:26 -07:00
use-mobile-dock-resize.ts feat(mobile): combine PR sidebar and checks parity (#5641) 2026-06-17 22:52:12 -07:00
use-mobile-image-attachment.ts 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
use-mobile-pr-actions.test.ts feat(mobile): combine PR sidebar and checks parity (#5641) 2026-06-17 22:52:12 -07:00
use-mobile-pr-actions.ts feat(mobile): combine PR sidebar and checks parity (#5641) 2026-06-17 22:52:12 -07:00
use-mobile-pr-ai-triage.ts feat(mobile): combine PR sidebar and checks parity (#5641) 2026-06-17 22:52:12 -07:00
use-mobile-pr-branch-context.test.ts feat(mobile): combine PR sidebar and checks parity (#5641) 2026-06-17 22:52:12 -07:00
use-mobile-pr-branch-context.ts feat(mobile): combine PR sidebar and checks parity (#5641) 2026-06-17 22:52:12 -07:00
use-mobile-pr-comment-actions.ts feat(mobile): combine PR sidebar and checks parity (#5641) 2026-06-17 22:52:12 -07:00
use-mobile-pr-sidebar-controller.test.ts feat(mobile): combine PR sidebar and checks parity (#5641) 2026-06-17 22:52:12 -07:00
use-mobile-pr-sidebar-controller.ts feat(mobile): combine PR sidebar and checks parity (#5641) 2026-06-17 22:52:12 -07:00
use-mobile-pr-title-action.ts feat(mobile): combine PR sidebar and checks parity (#5641) 2026-06-17 22:52:12 -07:00
worktree-label.ts fix(mobile): recover Android remote sessions without an app restart (#5061) 2026-06-09 17:55:20 -07:00