[PR #1942] [MERGED] Add managed avatar thumbnails #5353

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/1942
Author: @Promansis
Created: 6/2/2026
Status: ✅ Merged
Merged: 6/2/2026
Merged by: @Promansis

Base: refactor ← Head: fix/1938-avatar-thumbnails


📝 Commits (1)

  • c48df97 Add managed avatar thumbnails

📊 Changes

14 files changed (+484 additions, -10 deletions)

View changed files

📝 src-tauri/Cargo.lock (+18 -0)
📝 src-tauri/Cargo.toml (+1 -1)
📝 src-tauri/src/commands/storage/avatars.rs (+344 -0)
📝 src-tauri/src/commands/storage/commands/media.rs (+10 -0)
📝 src-tauri/src/http_dispatch.rs (+6 -0)
📝 src-tauri/src/http_server.rs (+22 -1)
📝 src-tauri/src/lib.rs (+1 -0)
📝 src/features/catalog/characters/components/CharacterAvatarImage.tsx (+23 -6)
📝 src/features/catalog/characters/components/CharacterGroupsSection.tsx (+5 -0)
📝 src/features/catalog/characters/components/CharacterLibraryCard.tsx (+1 -0)
📝 src/features/catalog/characters/components/CharacterListRow.tsx (+1 -0)
📝 src/features/catalog/characters/hooks/use-characters-panel-data.ts (+10 -1)
📝 src/shared/api/local-file-api.ts (+41 -1)
📝 src/shared/api/remote-runtime.ts (+1 -0)

📄 Description

Linked issue

Closes #1938

Why this change

  • Character catalog grids and grouped previews currently load full managed avatar files, which can make dense character views slower and heavier than needed.

What changed

  • Added managed avatar thumbnail generation for 64, 96, 128, and 256 pixel sizes in Rust storage.
  • Added hostable /api/assets/avatar-thumbnail/... handling and remote runtime command routing for thumbnail path resolution.
  • Updated catalog character avatar surfaces to request thumbnails where smaller images are enough.
  • Added thumbnail cleanup when managed avatar files are removed.

Refactor impact

Primary owner:

Rust storage, shared API, remote runtime, catalog characters.

Impact areas reviewed:

  • Managed avatar persistence and removal paths.
  • Tauri command registration and hostable HTTP dispatch.
  • Shared local/remote asset URL resolution.
  • Catalog character library cards, rows, and group previews.

Boundary notes:

  • Thumbnail generation stays in Rust storage.
  • React catalog UI calls typed shared API helpers only.
  • Remote-capable behavior uses the explicit shared API -> remote allowlist -> HTTP dispatch/Rust command path.

Pressure points touched:

  • src-tauri/src/lib.rs command registration.
  • src-tauri/src/http_dispatch.rs command dispatch.
  • src-tauri/src/http_server.rs managed asset route.
  • src/shared/api/local-file-api.ts and src/shared/api/remote-runtime.ts.

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

  • git diff --check
  • cargo test --manifest-path src-tauri/Cargo.toml avatar_thumbnail
  • pnpm typecheck
  • pnpm check:architecture
  • cargo check --manifest-path src-tauri/Cargo.toml
  • pnpm build

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:

  • This is an internal performance/storage behavior change for existing avatar displays.

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 captured. The change affects existing avatar image loading paths; local command validation covered the storage/API/build contracts.

🔄 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/1942 **Author:** [@Promansis](https://github.com/Promansis) **Created:** 6/2/2026 **Status:** ✅ Merged **Merged:** 6/2/2026 **Merged by:** [@Promansis](https://github.com/Promansis) **Base:** `refactor` ← **Head:** `fix/1938-avatar-thumbnails` --- ### 📝 Commits (1) - [`c48df97`](https://github.com/Pasta-Devs/Marinara-Engine/commit/c48df973c5d53d200449581310439e792e02d72f) Add managed avatar thumbnails ### 📊 Changes **14 files changed** (+484 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `src-tauri/Cargo.lock` (+18 -0) 📝 `src-tauri/Cargo.toml` (+1 -1) 📝 `src-tauri/src/commands/storage/avatars.rs` (+344 -0) 📝 `src-tauri/src/commands/storage/commands/media.rs` (+10 -0) 📝 `src-tauri/src/http_dispatch.rs` (+6 -0) 📝 `src-tauri/src/http_server.rs` (+22 -1) 📝 `src-tauri/src/lib.rs` (+1 -0) 📝 `src/features/catalog/characters/components/CharacterAvatarImage.tsx` (+23 -6) 📝 `src/features/catalog/characters/components/CharacterGroupsSection.tsx` (+5 -0) 📝 `src/features/catalog/characters/components/CharacterLibraryCard.tsx` (+1 -0) 📝 `src/features/catalog/characters/components/CharacterListRow.tsx` (+1 -0) 📝 `src/features/catalog/characters/hooks/use-characters-panel-data.ts` (+10 -1) 📝 `src/shared/api/local-file-api.ts` (+41 -1) 📝 `src/shared/api/remote-runtime.ts` (+1 -0) </details> ### 📄 Description ## Linked issue Closes #1938 ## Why this change - Character catalog grids and grouped previews currently load full managed avatar files, which can make dense character views slower and heavier than needed. ## What changed - Added managed avatar thumbnail generation for 64, 96, 128, and 256 pixel sizes in Rust storage. - Added hostable `/api/assets/avatar-thumbnail/...` handling and remote runtime command routing for thumbnail path resolution. - Updated catalog character avatar surfaces to request thumbnails where smaller images are enough. - Added thumbnail cleanup when managed avatar files are removed. ## Refactor impact Primary owner: Rust storage, shared API, remote runtime, catalog characters. Impact areas reviewed: - Managed avatar persistence and removal paths. - Tauri command registration and hostable HTTP dispatch. - Shared local/remote asset URL resolution. - Catalog character library cards, rows, and group previews. Boundary notes: - Thumbnail generation stays in Rust storage. - React catalog UI calls typed shared API helpers only. - Remote-capable behavior uses the explicit shared API -> remote allowlist -> HTTP dispatch/Rust command path. Pressure points touched: - `src-tauri/src/lib.rs` command registration. - `src-tauri/src/http_dispatch.rs` command dispatch. - `src-tauri/src/http_server.rs` managed asset route. - `src/shared/api/local-file-api.ts` and `src/shared/api/remote-runtime.ts`. ## 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 - [x] Human/manual validation completed by contributor or reviewer ### Manual verification notes - `git diff --check` - `cargo test --manifest-path src-tauri/Cargo.toml avatar_thumbnail` - `pnpm typecheck` - `pnpm check:architecture` - `cargo check --manifest-path src-tauri/Cargo.toml` - `pnpm build` ## 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. - [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: - This is an internal performance/storage behavior change for existing avatar displays. ## Docs and release impact - [x] 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 captured. The change affects existing avatar image loading paths; local command validation covered the storage/API/build contracts. --- <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#5353
No description provided.