mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #3360] [MERGED] fix(lorebooks): add unembed action + clarify embedded-lorebook UX #5899
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#5899
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/3360
Author: @kolacheee
Created: 7/8/2026
Status: ✅ Merged
Merged: 7/8/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/3359-unembed-lorebook📝 Commits (4)
514258bfix(lorebooks): add unembed action + clarify embedded-lorebook UX (#3359)96ac1c4fix(lorebooks): make Remove from card an immediate server write + toast (#3359)a94edb6Address embedded lorebook unembed race55047e4Block embedded lorebook import remove overlap📊 Changes
6 files changed (+176 additions, -12 deletions)
View changed files
📝
CHANGELOG.md(+1 -0)📝
packages/client/src/components/characters/CharacterEditor.tsx(+109 -6)📝
packages/client/src/components/lorebooks/LorebookAssignmentSection.tsx(+11 -2)📝
packages/client/src/hooks/use-lorebooks.ts(+2 -2)📝
packages/server/src/routes/characters.routes.ts(+14 -1)📝
packages/server/src/services/lorebook/character-book-sync.ts(+39 -1)📄 Description
Linked issue
Closes #3359
Why this change
The Character editor's Lorebook tab gave no way to unembed a lorebook. Once a lorebook was baked into a card (
data.character_book), the row's 🗑️ only unlinked the standalone copy — it never clearedcharacter_book, so the embedded lorebook silently persisted in the card (still listed, still exported), and "Removed …" implied it was gone. Separately, "Edit Linked Lorebook" opens the standalone mirror (which syncs intocharacter_book), muddling the embedded-vs-linked distinction.Verified beforehand (see #3359): this was purely a UX/management gap, not a data-integrity or double-injection bug — an embedded
character_bookis inert at runtime; only the standalone activates.What changed
DELETE /characters/:id/embedded-lorebook→clearEmbeddedLorebookFromCharacter, which dropsdata.character_bookand theextensions.importMetadata.embeddedLorebookpointer), reconciled with the editor exactly the way Embed / Import / Reimport already are: patchformDatawhen the editor is dirty (so other unsaved edits survive and a later Save can't re-embed it) and re-sync from the detail refetch when it's clean. Clearing the pointer also stops the standalone→character_booksync from re-baking it. The linked standalone lorebook, if any, is left intact. Destructive → gated behind awindow.confirm, shows a spinner while working, and toasts on success.CharacterEditor.tsx,use-lorebooks.ts, andcharacter-book-sync.ts).Server: one new
DELETEroute +clearEmbeddedLorebookFromCharacter(a sibling of the existingclearCharacterEmbeddedLorebook). No shared-package or schema changes.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
pnpm --filter @marinara-engine/client build,pnpm --filter @marinara-engine/client lint. (Fullpnpm checkis blocked on Windows by the pre-existing serverbuild.mjsissue, unrelated to this change.)character_bookbut no standalone (orphaned case).Docs and release impact
CHANGELOG updated (Fixed). No version bump.
UI evidence (if applicable)
Summary by CodeRabbit
New Features
Bug Fixes
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.