mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #1583] [Issue]: character library and panel render all cards as DOM nodes simultaneously — no virtualization #821
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#821
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?
Originally created by @Gunterlie on GitHub (May 29, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1583
Originally assigned to: @Xelvanis on GitHub.
Summary
CharacterLibraryViewandCharactersPanelmap every character directly to DOM nodes with no windowing. At 200 characters there are 200 full card elements in the DOM at once. Additionally, both components calluseCharacters()(full records) instead ofuseCharacterSummaries(), fetching fields likedescription,personality, andscenariothat are never displayed in a list card. Neither issue requires backend changes.Expected behavior
The library grid and sidebar panel scroll smoothly at any collection size. Only visible cards exist in the DOM.
Actual behavior
useCharacters()fetchesdescription,personality,scenario,first_mes, andalternate_greetings(~10 KB per character) that are unused in list contextSteps to reproduce
Environment
Additional context
Affected files
src/features/catalog/characters/components/CharacterLibraryView.tsxuseCharacters()— full recordssrc/features/catalog/characters/components/CharacterLibraryView.tsxsortedCharacters.map(...)— no windowingsrc/features/catalog/characters/components/CharactersPanel.tsxuseCharacters()— full records@tanstack/react-virtualis not currently installed. No virtualization library is present inpackage.json.Fix
Part A — Switch to summaries
Same change in
CharactersPanel.tsxline 115. Full record data is only needed in the detail/editor view, not the list.Part B — Virtualize the grid and list
Install
@tanstack/react-virtualand wrap thesortedCharacters.map(...)inCharacterLibraryViewand the list inCharactersPanelwith a virtualizer. Only ~30 DOM nodes exist at any time regardless of collection size.Note: after issue #1 (avatar payload fix) is merged, avatar images will be real URLs and
loading="lazy"will apply — virtualization then means only visible cards ever request their avatar image.Template check