Skip to content

fix(mobile): render photo library picks to a bounded JPEG off the JS thread - #546

Merged
rynfar merged 1 commit into
pylonfrom
upstream/2026-09-14-mobile-photo-jpeg
Sep 14, 2026
Merged

fix(mobile): render photo library picks to a bounded JPEG off the JS thread#546
rynfar merged 1 commit into
pylonfrom
upstream/2026-09-14-mobile-photo-jpeg

Conversation

@rynfar

@rynfar rynfar commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

Ports upstream commit bbedad0278bbf753503184c00e0c09a0eab6679c (#11440).

When picking images on mobile from the photo library:

  • Offloads decoding, downscaling (max edge 2048px), and JPEG re-encoding of photo library picks off the JS thread using native expo-image-manipulator.
  • Avoids UI stalls and OOM crashes caused by asking the iOS image picker for full-size base64 strings of high-resolution / camera photos.
  • Preserves supported originals (PNG, GIF, WebP, JPEG <= 10MB) intact without re-encoding to retain animations and transparency.
  • Preserves Pylon product branding in docs/user/composer.md.
  • Advances reviewed-through cursor in .agents/upstream-review.md to bbedad0278bbf753503184c00e0c09a0eab6679c.

Verification

  • Added mock and tests in apps/mobile/src/lib/composerFiles.test.ts (46 tests passed).
  • All 194 mobile test files (1,694 tests) passed.
  • Typecheck (tsc -b apps/mobile) passed with 0 errors.
  • Lint (vp lint) passed with 0 warnings/errors.

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@vercel

vercel Bot commented Sep 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
pylon-marketing Ready Ready Preview Sep 14, 2026 6:45am UTC

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L labels Sep 14, 2026
@rynfar
rynfar merged commit 0bef062 into pylon Sep 14, 2026
19 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 14.0 KiB 14.0 KiB −24 B (−0.2%) 15.1 KiB
Codex Thread snapshot wire 7.2 KiB 7.2 KiB +7 B (+0.1%) 7.3 KiB
Codex Live turn WebSocket wire 6.8 KiB 6.8 KiB −31 B (−0.4%) 7.8 KiB
Codex Live turn WebSocket decoded 58.8 KiB 58.8 KiB −44 B (−0.1%) 66.4 KiB
Codex Live turn messages 9 8 −1 (−11.1%) 21
Claude Total thread wire 14.1 KiB 14.1 KiB +22 B (+0.2%) 15.1 KiB
Claude Thread snapshot wire 7.2 KiB 7.2 KiB +2 B (+0.0%) 7.3 KiB
Claude Live turn WebSocket wire 6.8 KiB 6.9 KiB +20 B (+0.3%) 7.8 KiB
Claude Live turn WebSocket decoded 59.7 KiB 59.7 KiB +44 B (+0.1%) 66.4 KiB
Claude Live turn messages 9 10 +1 (+11.1%) 21

Baseline: ce7a421 · PR result: f5a45fb · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 115.6 KiB
  • Claude decoded thread snapshot: 116.3 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

@rynfar
rynfar deleted the upstream/2026-09-14-mobile-photo-jpeg branch September 14, 2026 06:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant