Skip to content

feat(app): add mobile image preview and save gestures#2342

Open
po1arbear wants to merge 2 commits into
getpaseo:mainfrom
po1arbear:codex/mobile-image-preview-download
Open

feat(app): add mobile image preview and save gestures#2342
po1arbear wants to merge 2 commits into
getpaseo:mainfrom
po1arbear:codex/mobile-image-preview-download

Conversation

@po1arbear

@po1arbear po1arbear commented Jul 23, 2026

Copy link
Copy Markdown

Summary

  • make assistant Markdown images tappable and open them in the existing full-screen lightbox
  • add familiar mobile gallery gestures: double-tap zoom, focal-point pinch-to-zoom up to 4×, and pan within the rendered image bounds
  • save local, data, and remote images to the device photo library on long press, with platform-aware permissions and visible pending/success/error feedback
  • preserve supported image formats, clean up temporary files safely, and localize the interaction copy for every supported language

Root cause

User image attachments already used the lightbox, but images returned by assistants were rendered as plain React Native Image elements. They had no press or long-press behavior, so mobile users could neither inspect the full-resolution image nor save it.

User impact

Assistant-returned images now follow standard mobile gallery behavior. A tap opens an immersive preview, zoom gestures keep the selected detail under the user's fingers, and a long press saves the image to Photos/the system gallery. The same save interaction also works from the existing attachment lightbox.

Validation

  • npm run build:app-deps
  • npm run build --workspace=@getpaseo/server
  • npm run lint
  • npm run typecheck
  • npx vitest run packages/app/src/images/save-to-library-core.test.ts packages/app/src/components/zoomable-image-geometry.test.ts packages/app/src/components/attachment-lightbox.test.tsx packages/app/src/i18n/resources.test.ts --bail=1 (60 tests)
  • npm run format:check
  • npx expo config --type public --json

@po1arbear
po1arbear marked this pull request as ready for review July 23, 2026 06:25
@greptile-apps

greptile-apps Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Adds mobile image preview, zoom/pan gestures, and photo-library saving.

  • Makes assistant Markdown images tappable and opens them in the shared lightbox.
  • Materializes data-image bytes before saving and safely cleans up temporary files.
  • Computes pinch focal translation and pan bounds from the contained image geometry.
  • Adds native media-library configuration, localized feedback, and focused tests.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failures remain in the fixes associated with the previous review threads.

Important Files Changed

Filename Overview
packages/app/src/images/save-to-library-core.ts Adds URI classification, data-image materialization, remote download normalization, and temporary-file cleanup for photo-library saves.
packages/app/src/images/save-to-library.native.ts Implements the native filesystem and media-library adapter, including base64 writes and platform-aware permission handling.
packages/app/src/components/zoomable-image.native.tsx Implements native pinch, pan, double-tap, long-press, measurement, and image-generation handling.
packages/app/src/components/zoomable-image-geometry.ts Adds pure contained-image pan-bound and focal-translation calculations.
packages/app/src/components/attachment-lightbox.tsx Integrates zoomable previews and native save feedback into the existing lightbox.
packages/app/src/components/message.tsx Makes resolved assistant Markdown images pressable and connects them to preview and save behavior.
packages/app/app.config.js Configures the Expo media-library plugin with save-only photo permissions.

Sequence Diagram

sequenceDiagram
  participant U as User
  participant I as Assistant image
  participant L as Lightbox
  participant S as Image saver
  participant P as Photo library
  U->>I: Tap
  I->>L: Open preview
  U->>L: Pinch, pan, or double-tap
  U->>I: Long press
  I->>S: Save URI and MIME type
  S->>S: Materialize or download if needed
  S->>P: Save image
  S-->>U: Pending, success, or error feedback
Loading

Reviews (5): Last reviewed commit: "feat(app): add mobile image preview and ..." | Re-trigger Greptile

Comment thread packages/app/src/images/save-to-library.native.ts Outdated
Comment thread packages/app/src/components/zoomable-image.native.tsx
Comment thread packages/app/src/components/zoomable-image.native.tsx Outdated
@po1arbear
po1arbear force-pushed the codex/mobile-image-preview-download branch 5 times, most recently from 4abbc22 to 7701948 Compare July 24, 2026 01:18
Open assistant images in a full-screen preview with double-tap, focal-point pinch zoom, and bounded panning.

Save local, remote, and data images to the system photo library with platform-aware permissions, format preservation, cleanup, and localized status feedback.
@po1arbear
po1arbear force-pushed the codex/mobile-image-preview-download branch from 7701948 to 1dc08eb Compare July 24, 2026 01:49
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