[PR #1940] [MERGED] Fix game asset backgrounds in settings picker #5351

Closed
opened 2026-10-22 04:15:30 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1940
Author: @cha1latte
Created: 6/2/2026
Status: ✅ Merged
Merged: 6/2/2026
Merged by: @cha1latte

Base: refactor ← Head: fix/issue-1928-game-asset-backgrounds


📝 Commits (2)

  • f4856fb Fix game asset backgrounds in settings picker
  • 3f1c15f Update discovery for game asset backgrounds

📊 Changes

3 files changed (+152 additions, -4 deletions)

View changed files

📝 src-tauri/src/commands/storage/backgrounds.rs (+129 -0)
📝 src/features/shell/discovery/discovery-entries.json (+2 -2)
📝 src/features/shell/settings/components/SettingsPanel.tsx (+21 -2)

📄 Description

Linked issue

Closes #1928

Why this change

  • The Settings background picker copy promises game asset backgrounds, but backgrounds_list only returned uploaded/user background rows. That meant bundled or custom game asset backgrounds were invisible in the picker even when they existed in the game asset manifest.

What changed

  • backgrounds_list now appends manifest backgrounds game assets as read-only picker rows with source: "game_asset" and marinara-game-asset: URLs.
  • The Settings background thumbnail path now resolves game-asset rows through the game asset resolver instead of the user-background resolver.
  • Added a Rust regression test covering user backgrounds, game asset backgrounds, read-only flags, encoded game asset URLs, and a non-background negative control.

Refactor impact

Primary owner:

  • Rust storage/background asset listing

Impact areas reviewed:

  • Settings background picker
  • Shared managed asset URL resolution path
  • Remote runtime asset URL path via marinara-game-asset:

Boundary notes:

  • Product behavior remains in the Rust storage/API boundary and the React consumer uses existing shared API wrappers/resolvers. No engine imports or raw Tauri calls were added.

Pressure points touched:

  • Settings panel background picker
  • backgrounds_list storage command

Validation

  • Matching validation command passes locally (for example pnpm typecheck, pnpm build, pnpm check:architecture, pnpm check:docs, or full pnpm check when warranted)
  • Full pnpm check passes before PR push/handoff
  • Human/manual validation completed by contributor or reviewer

Manual verification notes

  • Codex reproduced the bug before the fix with cargo test --manifest-path src-tauri\Cargo.toml list_backgrounds_includes_non_editable_game_asset_backgrounds; it failed because the game asset background row was missing.
  • After the fix, the same targeted test passed. It verifies the uploaded user row remains present, the game asset background is returned as read-only, the URL is encoded as marinara-game-asset:backgrounds%2Ffantasy%2Fcastle.png, and a non-background music asset is excluded.
  • pnpm typecheck passed.
  • cargo check --manifest-path src-tauri\Cargo.toml passed.
  • node C:\Users\celia\.codex\tools\marinara-proof-gate.mjs scratch\bugfix-verification.json passed.
  • Final pnpm check passed.
  • Bunny review pass: passed before PR open against the current upstream/refactor workflow base.
  • No manual blocker identified. No browser screenshot attached because the core regression is the route contract and was proven with the targeted Rust regression test; the PR remains draft for reviewer-visible UI inspection if desired.

Feature Discoverability

Check exactly one:

  • Updated src/features/shell/discovery/ because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool.
  • N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find.

Reason:

  • Updated the existing Themes, Fonts, And Backgrounds discovery entry so users can find game asset backgrounds through the Appearance/Settings surface.

Docs and release impact

  • No docs changes needed
  • Updated README.md
  • Updated CONTRIBUTING.md
  • Updated docs/developer/
  • Updated repo skills or AGENTS.md
  • Confirmed this PR does not restore old staging/package-workspace/release claims

UI evidence

  • Not attached. This is a Settings-visible bug, but the fixed claim is the backgrounds_list API contract plus resolver path; the route regression test and pnpm check are the available machine proof in this draft.

Summary by CodeRabbit

  • New Features

    • Game asset backgrounds are now available in the background picker alongside user-uploaded backgrounds.
    • Background thumbnails load correctly for all available backgrounds in settings.
  • Documentation

    • Updated discovery entries to reflect expanded background customization options.

🔄 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/1940 **Author:** [@cha1latte](https://github.com/cha1latte) **Created:** 6/2/2026 **Status:** ✅ Merged **Merged:** 6/2/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `refactor` ← **Head:** `fix/issue-1928-game-asset-backgrounds` --- ### 📝 Commits (2) - [`f4856fb`](https://github.com/Pasta-Devs/Marinara-Engine/commit/f4856fb0b50982ed4dc0003d708cbda51aae51f3) Fix game asset backgrounds in settings picker - [`3f1c15f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/3f1c15f7315bc6d3f6bb8ee99e57d6d542c1e334) Update discovery for game asset backgrounds ### 📊 Changes **3 files changed** (+152 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `src-tauri/src/commands/storage/backgrounds.rs` (+129 -0) 📝 `src/features/shell/discovery/discovery-entries.json` (+2 -2) 📝 `src/features/shell/settings/components/SettingsPanel.tsx` (+21 -2) </details> ### 📄 Description <!-- Target branch: `refactor`. Change the base to `refactor` before submitting unless a maintainer explicitly asked for another base. --> <!-- Keep all checkboxes unchecked until a human has actually verified them. --> ## Linked issue Closes #1928 ## Why this change - The Settings background picker copy promises game asset backgrounds, but `backgrounds_list` only returned uploaded/user background rows. That meant bundled or custom game asset backgrounds were invisible in the picker even when they existed in the game asset manifest. ## What changed - `backgrounds_list` now appends manifest `backgrounds` game assets as read-only picker rows with `source: "game_asset"` and `marinara-game-asset:` URLs. - The Settings background thumbnail path now resolves game-asset rows through the game asset resolver instead of the user-background resolver. - Added a Rust regression test covering user backgrounds, game asset backgrounds, read-only flags, encoded game asset URLs, and a non-background negative control. ## Refactor impact Primary owner: - Rust storage/background asset listing Impact areas reviewed: - Settings background picker - Shared managed asset URL resolution path - Remote runtime asset URL path via `marinara-game-asset:` Boundary notes: - Product behavior remains in the Rust storage/API boundary and the React consumer uses existing shared API wrappers/resolvers. No engine imports or raw Tauri calls were added. Pressure points touched: - Settings panel background picker - `backgrounds_list` storage command ## Validation - [ ] Matching validation command passes locally (for example `pnpm typecheck`, `pnpm build`, `pnpm check:architecture`, `pnpm check:docs`, or full `pnpm check` when warranted) - [ ] Full `pnpm check` passes before PR push/handoff - [ ] Human/manual validation completed by contributor or reviewer ### Manual verification notes - Codex reproduced the bug before the fix with `cargo test --manifest-path src-tauri\Cargo.toml list_backgrounds_includes_non_editable_game_asset_backgrounds`; it failed because the game asset background row was missing. - After the fix, the same targeted test passed. It verifies the uploaded user row remains present, the game asset background is returned as read-only, the URL is encoded as `marinara-game-asset:backgrounds%2Ffantasy%2Fcastle.png`, and a non-background music asset is excluded. - `pnpm typecheck` passed. - `cargo check --manifest-path src-tauri\Cargo.toml` passed. - `node C:\Users\celia\.codex\tools\marinara-proof-gate.mjs scratch\bugfix-verification.json` passed. - Final `pnpm check` passed. - Bunny review pass: passed before PR open against the current `upstream/refactor` workflow base. - No manual blocker identified. No browser screenshot attached because the core regression is the route contract and was proven with the targeted Rust regression test; the PR remains draft for reviewer-visible UI inspection if desired. ## Feature Discoverability Check exactly one: - [x] Updated `src/features/shell/discovery/` because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool. - [ ] N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find. Reason: - Updated the existing Themes, Fonts, And Backgrounds discovery entry so users can find game asset backgrounds through the Appearance/Settings surface. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated `README.md` - [ ] Updated `CONTRIBUTING.md` - [ ] Updated `docs/developer/` - [ ] Updated repo skills or `AGENTS.md` - [ ] Confirmed this PR does not restore old staging/package-workspace/release claims ## UI evidence - Not attached. This is a Settings-visible bug, but the fixed claim is the `backgrounds_list` API contract plus resolver path; the route regression test and `pnpm check` are the available machine proof in this draft. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Game asset backgrounds are now available in the background picker alongside user-uploaded backgrounds. * Background thumbnails load correctly for all available backgrounds in settings. * **Documentation** * Updated discovery entries to reflect expanded background customization options. <!-- 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-22 04:15:30 +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#5351
No description provided.