mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #1590] [MERGED] [codex] Optimize character summary avatar loading #5130
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#5130
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1590
Author: @Xelvanis
Created: 5/29/2026
Status: ✅ Merged
Merged: 5/29/2026
Merged by: @Xelvanis
Base:
refactor← Head:codex/character-collection-performance📝 Commits (4)
a36acfeOptimize character summary avatar loading135ddafFix summary fanout and lorebook filters96fc2a7Fix character summary hook stabilityb720ca4Harden managed asset URL segments📊 Changes
15 files changed (+336 additions, -89 deletions)
View changed files
📝
src-tauri/src/http_server.rs(+29 -1)📝
src/app/shell/ChatSidebar.tsx(+35 -10)📝
src/features/catalog/characters/components/CharacterAvatarImage.tsx(+11 -3)📝
src/features/catalog/characters/hooks/use-characters.ts(+35 -15)📝
src/features/catalog/characters/index.ts(+1 -0)➕
src/features/catalog/characters/lib/character-avatar-url.ts(+12 -0)📝
src/features/catalog/lorebooks/components/LorebookEditor.tsx(+30 -15)📝
src/features/catalog/lorebooks/components/LorebooksPanel.tsx(+17 -3)📝
src/features/modes/game/components/GameSetupWizard.tsx(+10 -9)📝
src/features/modes/router/components/RecentChats.tsx(+11 -11)📝
src/features/modes/shared/chat-ui/components/ChatSettingsDrawer.tsx(+11 -1)📝
src/features/modes/shared/chat-ui/components/ChatSetupWizard.tsx(+23 -9)📝
src/features/modes/shared/chat-ui/hooks/use-chat-surface-data.ts(+21 -8)➕
src/shared/api/local-file-api.test.ts(+67 -0)📝
src/shared/api/local-file-api.ts(+23 -4)📄 Description
Linked issue
Closes #1582
Refs #1584, #1583, #1585
Why this change
Character summary consumers were still paying for embedded avatar payloads or broad character reads in places that only needed names, tags, metadata, and avatar file handles. That made startup/sidebar/lorebook surfaces expensive for large character libraries and kept remote-hosted avatar display tied to local absolute paths or inline data.
What changed
id, display metadata, comment,avatarFilePath, andavatarFilenameinstead of embeddedavatarPathdata.storage_getreads per character./api/assets/avatar/...managed avatar route with filename sanitization.Refactor impact
Primary owner:
catalog characters, catalog lorebooks, app shell, shared mode UI, shared API, remote runtime/Rust storage asset serving
Impact areas reviewed:
Boundary notes:
Pressure points touched:
src/app/shell/ChatSidebar.tsxsrc/features/modes/shared/chat-ui/*src/features/catalog/lorebooks/*src-tauri/src/http_server.rsValidation
pnpm checkpasses locallypnpm typecheckpasses locallypnpm buildpasses locallypnpm check:architecturepasses locallypnpm check:docspasses locallycargo check --manifest-path src-tauri/Cargo.toml --workspacepasses locallyManual verification notes
Automated/local checks run by Codex:
pnpm exec vitest run src/shared/api/local-file-api.test.ts src/features/catalog/characters/hooks/use-characters.test.tspassedcargo test --manifest-path src-tauri/Cargo.toml avatar_asset_filename_rejects_parent_directory_tokenspassedpnpm typecheckpassedpnpm check:architecturepassedpnpm check:rustpassed before the final Bunny follow-up fixgit diff --check origin/refactor...HEADpassedManual app verification not run in this pass. Remote runtime route has unit coverage for filename guarding but no end-to-end browser smoke.
Docs and release impact
README.mdCONTRIBUTING.mddocs/developer/AGENTS.mdNo changelog file was found at the repo root; no docs changes were made because this is an internal performance/runtime-path fix with unchanged user-facing workflow.
UI evidence
No screenshots or recordings attached; UI behavior changes are data-loading/avatar-path changes rather than a visual redesign.
Summary by CodeRabbit
Release Notes
New Features
Improvements
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.