[PR #7132] [MERGED] feat(backgrounds): download a background from the library (#7129) #7490

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/7132
Author: @SpicyMarinara
Created: 10/5/2026
Status: ✅ Merged
Merged: 10/5/2026
Merged by: @SpicyMarinara

Base: staging ← Head: feat/background-download-7129


📝 Commits (1)

  • cd752aa feat(backgrounds): download a background from the library (#7129)

📊 Changes

6 files changed (+85 additions, -1 deletions)

View changed files

📝 CHANGELOG.md (+1 -0)
📝 docs/appearance/chat-backgrounds.md (+5 -1)
➕ e2e/background-download.e2e.ts (+49 -0)
📝 packages/client/src/components/panels/settings/BackgroundPicker.tsx (+14 -0)
📝 packages/client/src/lib/file-download.ts (+14 -0)
📝 packages/client/src/localization/locales/en.json (+2 -0)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #7129

Why this change

  • The background library let you rename or delete a background, but there was no way to get the image back out, for example to move it to another device or share it.

What changed

  • Each background card has a Download button beside Rename and Delete, built-in backgrounds included. It saves the image under its file name.
  • New saveExportUrl(url, filename) in lib/file-download.ts: fetches from the tap and hands the file to the shared saveExportFile (#7125), so it works on desktop (plain download), Android (shell bridge) and iPhone (share sheet, or Save file when the sheet can't open). A failed fetch shows the shared export error toast.
  • New strings: ui.panels.backgroundpicker.downloadBackground, ui.panels.backgroundpicker.downloadValue1.
  • New e2e e2e/background-download.e2e.ts (desktop-chromium + mobile-webkit): uploads a background, clicks Download, and checks the file name and bytes. It fails on staging (button missing) and passes here.
  • Docs: docs/appearance/chat-backgrounds.md gains a "Download a background" section; CHANGELOG entry added.

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

Agent-run checks: pnpm check, pnpm localization:check, Prettier, the new e2e on desktop-chromium and mobile-webkit, and local CodeRabbit (0 findings).

Manual verification notes

  • Manually verify in a desktop browser that Download on an uploaded background and on a built-in Game asset background saves the image with its file name.
  • Manually verify on a real iPhone (PWA and Safari) that Download opens the share sheet, or shows Save file that saves the image when tapped.
  • Manually verify in the Android app that Download saves the image through the app.
  • Manually verify that the button shows on hover over the image on desktop, always shows on phones, and looks right in light and dark mode.
  • Manually verify that a failed download (for example with the server stopped) shows an error toast.

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] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

Changed docs: docs/appearance/chat-backgrounds.md, CHANGELOG.md. Translations follow in a docs-i18n PR.

Summary by CodeRabbit

  • New Features
    • Backgrounds in the library, including built-in images, can now be downloaded using their filenames.
    • On iPhone and iPad, downloads open the share sheet; if it can’t open, a Save file option is offered.
  • Documentation
    • Updated the background-library guide with download instructions.

🔄 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/7132 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/5/2026 **Status:** ✅ Merged **Merged:** 10/5/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `feat/background-download-7129` --- ### 📝 Commits (1) - [`cd752aa`](https://github.com/Pasta-Devs/Marinara-Engine/commit/cd752aa414b91da21cce1191c24db0d6b5f9ce58) feat(backgrounds): download a background from the library (#7129) ### 📊 Changes **6 files changed** (+85 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -0) 📝 `docs/appearance/chat-backgrounds.md` (+5 -1) ➕ `e2e/background-download.e2e.ts` (+49 -0) 📝 `packages/client/src/components/panels/settings/BackgroundPicker.tsx` (+14 -0) 📝 `packages/client/src/lib/file-download.ts` (+14 -0) 📝 `packages/client/src/localization/locales/en.json` (+2 -0) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. ## Linked issue Closes #7129 ## Why this change - The background library let you rename or delete a background, but there was no way to get the image back out, for example to move it to another device or share it. ## What changed - Each background card has a **Download** button beside Rename and Delete, built-in backgrounds included. It saves the image under its file name. - New `saveExportUrl(url, filename)` in `lib/file-download.ts`: fetches from the tap and hands the file to the shared `saveExportFile` (#7125), so it works on desktop (plain download), Android (shell bridge) and iPhone (share sheet, or **Save file** when the sheet can't open). A failed fetch shows the shared export error toast. - New strings: `ui.panels.backgroundpicker.downloadBackground`, `ui.panels.backgroundpicker.downloadValue1`. - New e2e `e2e/background-download.e2e.ts` (desktop-chromium + mobile-webkit): uploads a background, clicks Download, and checks the file name and bytes. It fails on staging (button missing) and passes here. - Docs: `docs/appearance/chat-backgrounds.md` gains a "Download a background" section; CHANGELOG entry added. ## 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` Agent-run checks: `pnpm check`, `pnpm localization:check`, Prettier, the new e2e on desktop-chromium and mobile-webkit, and local CodeRabbit (0 findings). ### Manual verification notes - [ ] Manually verify in a desktop browser that Download on an uploaded background and on a built-in Game asset background saves the image with its file name. - [ ] Manually verify on a real iPhone (PWA and Safari) that Download opens the share sheet, or shows **Save file** that saves the image when tapped. - [ ] Manually verify in the Android app that Download saves the image through the app. - [ ] Manually verify that the button shows on hover over the image on desktop, always shows on phones, and looks right in light and dark mode. - [ ] Manually verify that a failed download (for example with the server stopped) shows an error toast. ## 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]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) Changed docs: `docs/appearance/chat-backgrounds.md`, `CHANGELOG.md`. Translations follow in a `docs-i18n` PR. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Backgrounds in the library, including built-in images, can now be downloaded using their filenames. * On iPhone and iPad, downloads open the share sheet; if it can’t open, a **Save file** option is offered. * **Documentation** * Updated the background-library guide with download instructions. <!-- 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:20:18 +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#7490
No description provided.