[PR #1998] [MERGED] Add managed asset thumbnail delivery #5383

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1998
Author: @Promansis
Created: 6/3/2026
Status: ✅ Merged
Merged: 6/3/2026
Merged by: @Promansis

Base: refactor ← Head: managed-asset-thumbnails


📝 Commits (2)

  • b2037e7 Add managed asset thumbnail delivery
  • 754b76b Fix managed thumbnail edge cases

📊 Changes

12 files changed (+522 additions, -21 deletions)

View changed files

📝 src-tauri/src/commands/storage.rs (+2 -0)
📝 src-tauri/src/commands/storage/commands/assets.rs (+11 -1)
➕ src-tauri/src/commands/storage/managed_thumbnails.rs (+292 -0)
📝 src-tauri/src/http_dispatch.rs (+46 -2)
📝 src-tauri/src/http_server.rs (+29 -2)
📝 src-tauri/src/lib.rs (+1 -0)
📝 src/features/catalog/characters/components/CharacterGalleryTab.tsx (+31 -5)
📝 src/features/catalog/lorebooks/components/panel/LorebookRow.tsx (+2 -2)
📝 src/features/modes/game-assets/components/AssetGrid.tsx (+5 -2)
📝 src/features/shell/settings/components/SettingsPanel.tsx (+3 -4)
📝 src/shared/api/local-file-api.ts (+99 -3)
📝 src/shared/api/remote-runtime.ts (+1 -0)

📄 Description

Linked issue

Closes #1994

Why this change

  • Repeated managed image grids were loading full-size background, gallery, game asset, and lorebook files into small thumbnail cells, which wasted transfer, decode, and memory work across repeated surfaces.

What changed

  • Added Rust-owned managed thumbnail generation and cache storage for background, gallery, game, and lorebook assets with stable bucket sizes.
  • Added embedded and remote-runtime thumbnail delivery through managed_asset_thumbnail_file_path and /api/assets/thumbnail/....
  • Updated game asset grid, settings background picker, character gallery grid, and lorebook rows to request thumbnails while keeping original files for full preview and download flows.
  • Extended managed asset invalidation so cached remote thumbnail blob URLs refresh when source assets change.

Refactor impact

Primary owner:

  • Shared API, Rust storage, remote runtime, catalog resources, game mode, shared mode UI

Impact areas reviewed:

  • Managed asset URL resolution in src/shared/api/local-file-api.ts
  • Remote runtime command allowlist and HTTP managed asset serving
  • Repeated image surfaces in settings, game assets, character gallery, and lorebook rows

Boundary notes:

  • Feature UI selects repeated thumbnail surfaces only.
  • Shared API owns embedded vs remote thumbnail URL resolution.
  • Rust owns managed asset path validation, thumbnail generation, cache freshness, and HTTP file delivery.
  • Original full-size asset routes remain in place for preview and download paths.

Pressure points touched:

  • src-tauri/src/lib.rs command registration
  • src-tauri/src/http_dispatch.rs remote invoke exposure
  • src-tauri/src/http_server.rs managed asset route handling

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

  • Ran pnpm typecheck
  • Ran cargo check --manifest-path src-tauri/Cargo.toml
  • Ran pnpm check:architecture
  • Ran cargo test --manifest-path src-tauri/Cargo.toml managed_thumbnail
  • Ran full pnpm check

Feature Discoverability

Check exactly one:

  • 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:

  • Existing image surfaces now request smaller managed thumbnails; no new user-discoverable workflow or setting was added.

Docs and release impact

  • No docs changes needed
  • Confirmed this PR does not restore old staging/package-workspace/release claims

UI evidence

  • Not captured in this session.

🔄 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/1998 **Author:** [@Promansis](https://github.com/Promansis) **Created:** 6/3/2026 **Status:** ✅ Merged **Merged:** 6/3/2026 **Merged by:** [@Promansis](https://github.com/Promansis) **Base:** `refactor` ← **Head:** `managed-asset-thumbnails` --- ### 📝 Commits (2) - [`b2037e7`](https://github.com/Pasta-Devs/Marinara-Engine/commit/b2037e7e6b14dee9565c6b34e1341f1f50948d71) Add managed asset thumbnail delivery - [`754b76b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/754b76bf55fcb2928c8f511bf905d02672c00b1f) Fix managed thumbnail edge cases ### 📊 Changes **12 files changed** (+522 additions, -21 deletions) <details> <summary>View changed files</summary> 📝 `src-tauri/src/commands/storage.rs` (+2 -0) 📝 `src-tauri/src/commands/storage/commands/assets.rs` (+11 -1) ➕ `src-tauri/src/commands/storage/managed_thumbnails.rs` (+292 -0) 📝 `src-tauri/src/http_dispatch.rs` (+46 -2) 📝 `src-tauri/src/http_server.rs` (+29 -2) 📝 `src-tauri/src/lib.rs` (+1 -0) 📝 `src/features/catalog/characters/components/CharacterGalleryTab.tsx` (+31 -5) 📝 `src/features/catalog/lorebooks/components/panel/LorebookRow.tsx` (+2 -2) 📝 `src/features/modes/game-assets/components/AssetGrid.tsx` (+5 -2) 📝 `src/features/shell/settings/components/SettingsPanel.tsx` (+3 -4) 📝 `src/shared/api/local-file-api.ts` (+99 -3) 📝 `src/shared/api/remote-runtime.ts` (+1 -0) </details> ### 📄 Description ## Linked issue Closes #1994 ## Why this change - Repeated managed image grids were loading full-size background, gallery, game asset, and lorebook files into small thumbnail cells, which wasted transfer, decode, and memory work across repeated surfaces. ## What changed - Added Rust-owned managed thumbnail generation and cache storage for `background`, `gallery`, `game`, and `lorebook` assets with stable bucket sizes. - Added embedded and remote-runtime thumbnail delivery through `managed_asset_thumbnail_file_path` and `/api/assets/thumbnail/...`. - Updated game asset grid, settings background picker, character gallery grid, and lorebook rows to request thumbnails while keeping original files for full preview and download flows. - Extended managed asset invalidation so cached remote thumbnail blob URLs refresh when source assets change. ## Refactor impact Primary owner: - Shared API, Rust storage, remote runtime, catalog resources, game mode, shared mode UI Impact areas reviewed: - Managed asset URL resolution in `src/shared/api/local-file-api.ts` - Remote runtime command allowlist and HTTP managed asset serving - Repeated image surfaces in settings, game assets, character gallery, and lorebook rows Boundary notes: - Feature UI selects repeated thumbnail surfaces only. - Shared API owns embedded vs remote thumbnail URL resolution. - Rust owns managed asset path validation, thumbnail generation, cache freshness, and HTTP file delivery. - Original full-size asset routes remain in place for preview and download paths. Pressure points touched: - `src-tauri/src/lib.rs` command registration - `src-tauri/src/http_dispatch.rs` remote invoke exposure - `src-tauri/src/http_server.rs` managed asset route handling ## Validation - [x] Matching validation command passes locally (for example `pnpm typecheck`, `pnpm build`, `pnpm check:architecture`, `pnpm check:docs`, or full `pnpm check` when warranted) - [x] Full `pnpm check` passes before PR push/handoff - [ ] Human/manual validation completed by contributor or reviewer ### Manual verification notes - Ran `pnpm typecheck` - Ran `cargo check --manifest-path src-tauri/Cargo.toml` - Ran `pnpm check:architecture` - Ran `cargo test --manifest-path src-tauri/Cargo.toml managed_thumbnail` - Ran full `pnpm check` ## Feature Discoverability Check exactly one: - [x] 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: - Existing image surfaces now request smaller managed thumbnails; no new user-discoverable workflow or setting was added. ## Docs and release impact - [x] No docs changes needed - [x] Confirmed this PR does not restore old staging/package-workspace/release claims ## UI evidence - Not captured in this session. --- <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:48 +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#5383
No description provided.