[PR #5682] [MERGED] Fix iPhone gallery image download trap #6882

Closed
opened 2026-10-23 04:14:33 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/5682
Author: @SpicyMarinara
Created: 8/30/2026
Status: ✅ Merged
Merged: 8/30/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/iphone-gallery-image-download


📝 Commits (4)

  • ab6fb8b fix: keep iPhone image downloads dismissible
  • dce35de chore: sort image download localization key
  • 9d04276 fix: preserve iOS share activation
  • c876e87 fix: surface iPhone image preparation failures

📊 Changes

6 files changed (+205 additions, -11 deletions)

View changed files

📝 CHANGELOG.md (+1 -0)
📝 e2e/core-flows.e2e.ts (+93 -0)
📝 packages/client/src/components/chat/ChatGallery.tsx (+20 -5)
📝 packages/client/src/components/chat/ChatImageLightbox.tsx (+44 -6)
📝 packages/client/src/lib/file-download.ts (+46 -0)
📝 packages/client/src/localization/locales/en.json (+1 -0)

📄 Description

Linked issue

Closes #5681

Why this change

  • An Illustrator image's direct <a download> link opens iOS's full-screen file preview in an installed home-screen app.
  • WebKit does not provide a dismiss or back control on that surface, leaving the user stuck until Marinara is force-closed.
  • The app cannot control that system preview or silently write to Photos, but iOS's share sheet is dismissible and provides the native Save Image action.

What changed

  • Preload the current gallery image in the existing lightbox on iPhone/iPad WebKit, then invoke the native share sheet directly from the user's download tap.
  • Route iOS gallery-card downloads through that existing lightbox so the file can be prepared without adding another interface.
  • Keep the current Android file bridge and ordinary browser download behavior everywhere else.
  • Add an iPhone-sized WebKit regression proving the share starts with active user activation and the app neither navigates away nor closes the lightbox.
  • Add localized failure feedback and an Unreleased changelog entry.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

Automated validation completed without checking the human verification boxes above:

  • pnpm check
  • pnpm version:check
  • PLAYWRIGHT_ONLY_PROJECT=mobile pnpm exec playwright test e2e/core-flows.e2e.ts --project=mobile-webkit --grep "iPhone gallery image saves"
  • The focused iPhone WebKit run uploaded a real PNG, entered the existing lightbox from the gallery download control, waited for the prepared file, and verified that the download tap called the share sheet with active user activation.
  • The same regression inspected the exact shared File and verified the lightbox and app URL remained unchanged.
  • Physical-iPhone verification remains a manual follow-up; the reporter's screenshots establish the native preview repro.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] <paths> follow-up issue opened
  • Version/release files updated (only if this PR includes a version bump)

No user documentation changes are needed; the existing Download action keeps its label and location. CHANGELOG.md is updated.

UI evidence (if applicable)

There is intentionally no visual redesign. The existing lightbox becomes the safe preparation surface on iOS; the behavior change is the native iOS handoff rather than new Marinara chrome.

Summary by CodeRabbit

  • New Features

    • iPhone users can save chat images through the native iOS share sheet.
    • Choosing Save Image adds the image to Photos and returns to the open image viewer.
    • The share sheet can be dismissed without leaving the image viewer.
    • Other platforms continue using the standard image download flow.
  • Bug Fixes

    • Added a localized error message when saving an image fails.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/5682 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 8/30/2026 **Status:** ✅ Merged **Merged:** 8/30/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/iphone-gallery-image-download` --- ### 📝 Commits (4) - [`ab6fb8b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ab6fb8b9ae63ce132f038f148fcc3a9abead9d2b) fix: keep iPhone image downloads dismissible - [`dce35de`](https://github.com/Pasta-Devs/Marinara-Engine/commit/dce35dea63412f215bd8a6f25c8d3dd16a7aaaf4) chore: sort image download localization key - [`9d04276`](https://github.com/Pasta-Devs/Marinara-Engine/commit/9d042766e720669dce15a0355187ad6c35c5ac97) fix: preserve iOS share activation - [`c876e87`](https://github.com/Pasta-Devs/Marinara-Engine/commit/c876e87d9e84141ebc6a612505e09ba1cacaf50c) fix: surface iPhone image preparation failures ### 📊 Changes **6 files changed** (+205 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -0) 📝 `e2e/core-flows.e2e.ts` (+93 -0) 📝 `packages/client/src/components/chat/ChatGallery.tsx` (+20 -5) 📝 `packages/client/src/components/chat/ChatImageLightbox.tsx` (+44 -6) 📝 `packages/client/src/lib/file-download.ts` (+46 -0) 📝 `packages/client/src/localization/locales/en.json` (+1 -0) </details> ### 📄 Description ## Linked issue Closes #5681 ## Why this change - An Illustrator image's direct `<a download>` link opens iOS's full-screen file preview in an installed home-screen app. - WebKit does not provide a dismiss or back control on that surface, leaving the user stuck until Marinara is force-closed. - The app cannot control that system preview or silently write to Photos, but iOS's share sheet is dismissible and provides the native Save Image action. ## What changed - Preload the current gallery image in the existing lightbox on iPhone/iPad WebKit, then invoke the native share sheet directly from the user's download tap. - Route iOS gallery-card downloads through that existing lightbox so the file can be prepared without adding another interface. - Keep the current Android file bridge and ordinary browser download behavior everywhere else. - Add an iPhone-sized WebKit regression proving the share starts with active user activation and the app neither navigates away nor closes the lightbox. - Add localized failure feedback and an Unreleased changelog entry. ## Validation - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` ### Manual verification notes Automated validation completed without checking the human verification boxes above: - `pnpm check` - `pnpm version:check` - `PLAYWRIGHT_ONLY_PROJECT=mobile pnpm exec playwright test e2e/core-flows.e2e.ts --project=mobile-webkit --grep "iPhone gallery image saves"` - The focused iPhone WebKit run uploaded a real PNG, entered the existing lightbox from the gallery download control, waited for the prepared file, and verified that the download tap called the share sheet with active user activation. - The same regression inspected the exact shared `File` and verified the lightbox and app URL remained unchanged. - Physical-iPhone verification remains a manual follow-up; the reporter's screenshots establish the native preview repro. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n] <paths>` follow-up issue opened - [ ] Version/release files updated (only if this PR includes a version bump) No user documentation changes are needed; the existing Download action keeps its label and location. `CHANGELOG.md` is updated. ## UI evidence (if applicable) There is intentionally no visual redesign. The existing lightbox becomes the safe preparation surface on iOS; the behavior change is the native iOS handoff rather than new Marinara chrome. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * iPhone users can save chat images through the native iOS share sheet. * Choosing **Save Image** adds the image to Photos and returns to the open image viewer. * The share sheet can be dismissed without leaving the image viewer. * Other platforms continue using the standard image download flow. * **Bug Fixes** * Added a localized error message when saving an image fails. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:14:33 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#6882
No description provided.