[PR #6785] [MERGED] fix: keep iOS gallery image saves inside the app #7332

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/6785
Author: @SpicyMarinara
Created: 9/27/2026
Status: ✅ Merged
Merged: 9/27/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/6784-ios-gallery-download


📝 Commits (5)

  • a082c6e docs: record iOS gallery download fix scope (#6784)
  • 586352f fix: preserve the app during iOS gallery image saves (#6784)
  • d3766a2 fix: preserve the app when native image sharing is unavailable
  • 5fac3ed Merge remote-tracking branch 'origin/staging' into fix/6784-ios-gallery-download
  • 98d61ce fix: let gallery confirmation dialogs own keyboard focus

📊 Changes

7 files changed (+384 additions, -77 deletions)

View changed files

📝 CHANGELOG.md (+2 -0)
📝 e2e/core-flows.e2e.ts (+235 -0)
📝 packages/client/src/components/characters/CharacterEditor.tsx (+43 -13)
📝 packages/client/src/components/chat/ChatImageLightbox.tsx (+3 -49)
📝 packages/client/src/components/personas/PersonaEditor.tsx (+43 -13)
➕ packages/client/src/components/ui/ImageDownloadButton.tsx (+54 -0)
📝 packages/client/src/lib/file-download.ts (+4 -2)

📄 Description

Linked issue

Closes #6784

Why this change

Downloading a character gallery image in the iPhone/iPad Home Screen app opens an image-only page without a way back, forcing a restart. Persona galleries use the same direct-link path.

What changed

  • Character and persona thumbnail downloads open a dismissible preview on iOS and reuse the chat gallery's prepared-image share control. The image is fetched before the save tap to retain user activation.
  • Share cancellation stays in the preview; share failure reports an error without automatically navigating away.
  • Browser fallback downloads target a separate browsing context, preserving the app when the share API is unavailable and WebKit previews the file. Desktop downloads and the Android save bridge remain supported.
  • Preview dialogs contain keyboard focus, support Escape, restore focus on close, and allow nested delete confirmations to handle their own focus through the existing owned-portal support.

Validation

  • pnpm check: passed on the final combined branch, including localization, types, lint, formatting and production build.
  • pnpm regression:ui e2e/core-flows.e2e.ts --grep 'gallery image saves (keep|return)|Persona sheets accept neutral full-body references' --workers=1: 10 passed, 2 expected skips for the iPhone-only chat case on Chromium.
  • pnpm smoke:ui: 7 passed on the final branch.
  • node scripts/run-regressions.mjs --filter scripts/regressions/open-issues.regression.ts: passed.
  • Regression coverage includes file identity/user activation, success/cancellation/rejection, fetch failure, no-share-API fallback, stable app URL, close controls, keyboard focus, nested confirmation cancellation/deletion, desktop download bytes, and Android bridge arguments. The original download test failed before the fix; the confirmation test also reproduced the review finding before its fix.
  • Local CodeRabbit completed the main patch and fallback follow-up. Initial focus findings were fixed. A suggestion to replace the pre-existing URL-share fallback for file types rejected by navigator.canShare was not adopted: broader unsupported-file saving behavior is separate from the reported navigation defect. This was not a zero-findings review overall.
  • The final nested-confirmation fix was reproduced, traced and browser-tested locally. Its local CodeRabbit rerun hit a 29-minute quota limit; the final GitHub CodeRabbit review remains required before merge.
  • 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

  • Manually verify Save Image, Save to Files and cancellation on a physical iPhone/iPad Home Screen app. Automated WebKit coverage mocks the native share API; it does not exercise Apple's native share UI.
  • Manually verify downloading from both a gallery thumbnail and an already-open preview, including an HTTP/local-network installation where the share API is unavailable.
  • No local container build; GitHub's required container-build-test remains a merge gate.

Docs and release impact

Unreleased changelog entry. Existing localized strings are reused; no version bump or translated documentation change.

UI evidence (if applicable)

Mobile WebKit gallery and preview screenshots. The preview screenshots show the intentionally rejected share and the still-available close control. The image fixture is transparent.

Summary by CodeRabbit

  • New Features
    • Character and persona gallery images can be saved using native sharing on iPhone and iPad, keeping the app open. Canceling a share leaves the preview available without showing an error.
    • Image downloads use the device’s available save options, including direct downloads in a new tab when appropriate.
  • Bug Fixes
    • Image previews remain dismissible after saving is canceled or fails. Saving errors are shown when applicable.
    • Gallery previews support keyboard dismissal and improved focus handling.

🔄 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/6785 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 9/27/2026 **Status:** ✅ Merged **Merged:** 9/27/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/6784-ios-gallery-download` --- ### 📝 Commits (5) - [`a082c6e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a082c6e3a7c80af65b9865f5f26e58cd47f66e85) docs: record iOS gallery download fix scope (#6784) - [`586352f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/586352fbc7c05f5fae85f19e1fd9352866306228) fix: preserve the app during iOS gallery image saves (#6784) - [`d3766a2`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d3766a2ee87271f026c875ed836a08f9db12aafd) fix: preserve the app when native image sharing is unavailable - [`5fac3ed`](https://github.com/Pasta-Devs/Marinara-Engine/commit/5fac3eddff8656b16b1fe32c0fea661289f0da40) Merge remote-tracking branch 'origin/staging' into fix/6784-ios-gallery-download - [`98d61ce`](https://github.com/Pasta-Devs/Marinara-Engine/commit/98d61ce48b9fc5474352b039519da0e1b6314721) fix: let gallery confirmation dialogs own keyboard focus ### 📊 Changes **7 files changed** (+384 additions, -77 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+2 -0) 📝 `e2e/core-flows.e2e.ts` (+235 -0) 📝 `packages/client/src/components/characters/CharacterEditor.tsx` (+43 -13) 📝 `packages/client/src/components/chat/ChatImageLightbox.tsx` (+3 -49) 📝 `packages/client/src/components/personas/PersonaEditor.tsx` (+43 -13) ➕ `packages/client/src/components/ui/ImageDownloadButton.tsx` (+54 -0) 📝 `packages/client/src/lib/file-download.ts` (+4 -2) </details> ### 📄 Description ## Linked issue Closes #6784 ## Why this change Downloading a character gallery image in the iPhone/iPad Home Screen app opens an image-only page without a way back, forcing a restart. Persona galleries use the same direct-link path. ## What changed - Character and persona thumbnail downloads open a dismissible preview on iOS and reuse the chat gallery's prepared-image share control. The image is fetched before the save tap to retain user activation. - Share cancellation stays in the preview; share failure reports an error without automatically navigating away. - Browser fallback downloads target a separate browsing context, preserving the app when the share API is unavailable and WebKit previews the file. Desktop downloads and the Android save bridge remain supported. - Preview dialogs contain keyboard focus, support Escape, restore focus on close, and allow nested delete confirmations to handle their own focus through the existing owned-portal support. ## Validation - `pnpm check`: passed on the final combined branch, including localization, types, lint, formatting and production build. - `pnpm regression:ui e2e/core-flows.e2e.ts --grep 'gallery image saves (keep|return)|Persona sheets accept neutral full-body references' --workers=1`: 10 passed, 2 expected skips for the iPhone-only chat case on Chromium. - `pnpm smoke:ui`: 7 passed on the final branch. - `node scripts/run-regressions.mjs --filter scripts/regressions/open-issues.regression.ts`: passed. - Regression coverage includes file identity/user activation, success/cancellation/rejection, fetch failure, no-share-API fallback, stable app URL, close controls, keyboard focus, nested confirmation cancellation/deletion, desktop download bytes, and Android bridge arguments. The original download test failed before the fix; the confirmation test also reproduced the review finding before its fix. - Local CodeRabbit completed the main patch and fallback follow-up. Initial focus findings were fixed. A suggestion to replace the pre-existing URL-share fallback for file types rejected by `navigator.canShare` was not adopted: broader unsupported-file saving behavior is separate from the reported navigation defect. This was not a zero-findings review overall. - The final nested-confirmation fix was reproduced, traced and browser-tested locally. Its local CodeRabbit rerun hit a 29-minute quota limit; the final GitHub CodeRabbit review remains required before merge. - [ ] `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 - Manually verify Save Image, Save to Files and cancellation on a physical iPhone/iPad Home Screen app. Automated WebKit coverage mocks the native share API; it does not exercise Apple's native share UI. - Manually verify downloading from both a gallery thumbnail and an already-open preview, including an HTTP/local-network installation where the share API is unavailable. - No local container build; GitHub's required container-build-test remains a merge gate. ## Docs and release impact Unreleased changelog entry. Existing localized strings are reused; no version bump or translated documentation change. ## UI evidence (if applicable) [Mobile WebKit gallery and preview screenshots](https://gist.github.com/SpicyMarinara/0980a8fe420f47e585058dfe57af3b03). The preview screenshots show the intentionally rejected share and the still-available close control. The image fixture is transparent. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Character and persona gallery images can be saved using native sharing on iPhone and iPad, keeping the app open. Canceling a share leaves the preview available without showing an error. * Image downloads use the device’s available save options, including direct downloads in a new tab when appropriate. * **Bug Fixes** * Image previews remain dismissible after saving is canceled or fails. Saving errors are shown when applicable. * Gallery previews support keyboard dismissal and improved focus handling. <!-- 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:18:44 +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#7332
No description provided.