mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #377] [CLOSED] Lorebook folders #4593
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#4593
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/377
Author: @kolacheee
Created: 5/3/2026
Status: ❌ Closed
Base:
main← Head:lorebook-folders📝 Commits (10+)
0b6c70cAdd files via upload9593ed4Add files via upload81b1930Add files via uploadf613957Add files via upload2ac512fAdd files via uploadfedf2b3Add files via uploadff5badeAdd files via uploadfbdc07cAdd files via uploaded8a765Add files via upload9b5af60Add files via upload📊 Changes
11 files changed (+2136 additions, -896 deletions)
View changed files
📝
CHANGELOG.md(+3 -0)📝
packages/client/src/components/lorebooks/LorebookEditor.tsx(+575 -838)➕
packages/client/src/components/lorebooks/LorebookEntryRow.tsx(+746 -0)➕
packages/client/src/components/lorebooks/LorebookFolderRow.tsx(+252 -0)📝
packages/client/src/hooks/use-lorebooks.ts(+86 -3)📝
packages/server/src/db/schema/lorebooks.ts(+32 -1)📝
packages/server/src/routes/lorebooks.routes.ts(+81 -9)📝
packages/server/src/services/import/marinara.importer.ts(+66 -30)📝
packages/server/src/services/storage/lorebooks.storage.ts(+226 -15)📝
packages/shared/src/schemas/lorebook.schema.ts(+25 -0)📝
packages/shared/src/types/lorebook.ts(+44 -0)📄 Description
<html>Summary
This is a different PR than the one I submitted earlier to add inline editing to Lorebook Entries.Adds a flat collapsible folder system to the Lorebook editor so large lorebooks (especially ones with many entries that exist mainly for AI agents to manage) can be organized into named groups instead of one long vertical list.
Builds on the previously-merged inline-edit row work — folders are a parallel structure that sit above the existing entry rows.
Why
Large lorebooks become hard to navigate quickly: stable / agent-managed entries dominate vertical space, drowning out the entries the user is actively editing. A collapsible folder lets the user park "set-and-forget" entries out of view without disabling them, and gives a single toggle to gate a whole bucket on/off.
Behavior
parentFolderIdfield reserved asnullso a follow-up PR can add nesting without another migration. The route layer rejects non-null values for now.localStorageper-lorebook) and an enable toggle (server-persisted). When the enable toggle is OFF, every entry inside the folder is excluded from activation regardless of the entry's ownenabledflag — and the entry's own flag is preserved untouched, so re-enabling the folder restores each entry's previous individual setting.folderIdback tonull) instead of cascading. The confirmation dialog says so explicitly.Architecture
Known limitations
parentFolderIdso a follow-up PR can add it without another migration; the route currently rejects non-null values.ordernumbering across containers will accumulate gaps over time as entries move between folders. This is harmless (it doesn't affect activation; lower-Order = earlier) and gets renumbered to (i+1)*10 within a container the next time a drag-reorder happens inside it.Test plan
A subset of these were exercised live in the running engine. The rest still need eyes-on verification before merging — they're called out below.
pnpm install&&pnpm db:push— confirmed locally; schema changes applied without errors.pnpm checkpasses locally with no new errors.orderwas preserved (the cross-container fix).lorebook-folder-collapsed:<lorebookId>localStorage key./api/lorebooks/active/entriesendpoint that entries inside the disabled folder are correctly gated out (4 of 6 entries returned), while each entry's ownenabledflag in/api/lorebooks/:id/entriesremainedtrue. Did not run a live chat-generation pass — the activation-gate is verified at the API layer rather than through end-to-end model output. Eyes-on chat-generation pass still recommended before merge./api/lorebooks/active/entriesreturned all 6 entries, individual flags still untouched.folderId: null), no data loss.group flex … gap-2andmax-md:opacity-100pattern as the entry row that already passes mobile review), but could have a cleaner look. Made a change so that it would wrap on overflow, instead of pushing Add Entry off to the side.folderIddefaults to null and the storage layer accepts the field, so default behavior should be unchanged.Screenshots
Dark ModeLight Mode

Mobile

</html>Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.