mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #1790] [Issue]: Gallery parity regressions: cleanup, import rendering, and Illustrate guard #871
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#871
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 @Xelvanis on GitHub (Jun 1, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1790
Originally assigned to: @SpicyMarinara on GitHub.
Summary
Gallery has several parity regressions compared with the legacy implementation:
Expected behavior
chat_imagesandcharacter_imagesrows imported into refactor storage render in the gallery UI.Actual behavior
Static code audit found these gaps:
src-tauri/src/commands/storage/chats.rs:delete_chat_with_messagesremoves tracker snapshots, messages, and chat rows, but does not delete matchinggalleryrecords.src-tauri/src/commands/storage/commands/entities.rs: generic delete only removes owned media for characters/personas/lorebooks and tracker snapshots for messages. It does not deletecharacter-galleryrecords when a character is deleted.src-tauri/src/commands/storage/profile/legacy.rs: legacychat_imagesandcharacter_imagestables are mapped intogalleryandcharacter-gallery.src-tauri/src/commands/storage/profile/assets.rs: legacy asset normalization rewrites avatar/image/background/sprite fields, but not galleryfilePathvalues.src/features/catalog/gallery/hooks/use-gallery.tsandsrc/features/catalog/characters/hooks/use-characters.ts: gallery UI lists storage rows and rendersimage.url, so imported rows with only legacyfilePathcan show broken images.src/shared/stores/gallery.store.ts: refactor gallery store only tracks pinned images. The legacy store had per-chatillustratingChatIds, so the pending guard survived drawer close/reopen.Legacy comparison from the previous package layout:
packages/server/src/db/file-backed-store.tscascadedchats -> chat_imagesandcharacters -> character_images.packages/server/src/services/storage/chats.storage.tsremoved chat gallery files on chat delete.packages/server/src/routes/characters.routes.tsremoved character gallery files on character delete.packages/server/src/services/storage/gallery-recovery.tsrecovered orphaned chat gallery files at startup.Steps to reproduce
gallerycollection for rows whosechatIdmatches the deleted chat.character-gallerycollection for rows whosecharacterIdmatches the deleted character.chat_imagesorcharacter_imagesrows withfilePathdata and no refactorurl, then open the gallery UI.Impact area
Environment
6cc9d086Logs, screenshots, or video
No screenshots or runtime logs. Evidence above is from static comparison of refactor gallery/storage paths against the legacy implementation.
Regression notes
The cleanup behavior existed in the legacy implementation through table cascades and explicit gallery folder removal. Exact last-good refactor commit was not identified.
Additional context
Refactor has gallery improvements such as regenerate-from-prompt and stronger character gallery lightbox focus handling. This issue only tracks the remaining parity breaks around cleanup, legacy import rendering, and duplicate manual Illustrate retries.
Template check
Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked:
@SpicyMarinara commented on GitHub (Jun 1, 2026):
Fixed on refactor in 02ccbcf9.\n\nWhat changed:\n- Chat deletion now removes matching chat gallery rows and managed gallery files.\n- Character deletion now removes matching character-gallery rows and managed gallery files.\n- Direct gallery row deletion also removes managed gallery files when present.\n- Legacy profile import now resolves chat_images/character_images filePath values into renderable data URLs and backfills filenames.\n- Gallery query hooks normalize imported rows that have filePath but no url.\n- Manual Illustrate now uses a per-chat pending guard in the gallery store, so closing/reopening the drawer cannot start a duplicate retry while one is running.\n\nVerification:\n- pnpm typecheck\n- pnpm check:architecture\n- cargo check --manifest-path src-tauri/Cargo.toml\n- cargo test --manifest-path src-tauri/Cargo.toml gallery\n- git diff --check