mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #6778] [MERGED] feat: add lorebook authoring and diagnostic tools #7328
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#7328
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/6778
Author: @SirAdoni
Created: 9/27/2026
Status: ✅ Merged
Merged: 9/28/2026
Merged by: @SpicyMarinara
Base:
staging← Head:contrib/6698-lorebook-tools📝 Commits (10+)
13cb507feat: add lorebook authoring and diagnostic tools53da51atest: verify lorebook tools on desktop and mobile4f2ffc4Merge staging and fix lorebook export regex complexityf409151fix: record lorebook activations after reply persistence408f1d3Merge staging inventory update into lorebook contribution8950c3eMerge commit '3355c32277' into contrib/6698-lorebook-toolse5a206efix: harden lorebook imports and diagnostic checks22991f7test: capture Windows readiness timeout diagnosticsd01afb7Merge remote-tracking branch 'pr-review/6778' into codex/assigned-67789707476Merge latest staging into reviewed lorebook tools📊 Changes
39 files changed (+4764 additions, -49 deletions)
View changed files
📝
CHANGELOG.md(+13 -1)➕
e2e/lorebook-tools.e2e.ts(+113 -0)➕
packages/client/src/components/lorebooks/LorebookBulkEditPanel.tsx(+278 -0)📝
packages/client/src/components/lorebooks/LorebookEditor.tsx(+208 -33)📝
packages/client/src/components/lorebooks/LorebookEntryRow.tsx(+26 -3)➕
packages/client/src/components/lorebooks/LorebookLintPanel.tsx(+185 -0)➕
packages/client/src/components/lorebooks/LorebookScanTest.tsx(+196 -0)➕
packages/client/src/components/lorebooks/LorebookTextImportDialog.tsx(+323 -0)📝
packages/client/src/components/panels/LorebooksPanel.tsx(+4 -2)➕
packages/client/src/components/panels/library/LorebookSelectionEnableActions.tsx(+88 -0)📝
packages/client/src/components/panels/settings/FeatureSwitchesSettings.tsx(+5 -1)📝
packages/client/src/components/ui/ExportFormatDialog.tsx(+18 -2)📝
packages/client/src/hooks/use-lorebooks.ts(+95 -1)📝
packages/client/src/localization/locales/en.json(+143 -0)📝
packages/server/src/app.ts(+2 -0)📝
packages/server/src/db/file-backed-store.ts(+3 -0)📝
packages/server/src/db/schema/index.ts(+1 -0)➕
packages/server/src/db/schema/lorebook-activation-stats.ts(+14 -0)📝
packages/server/src/routes/generate.routes.ts(+8 -0)➕
packages/server/src/routes/lorebook-text.routes.ts(+93 -0)...and 19 more files
📄 Description
Linked issue
Closes #6806. Partial implementation of #6698; the umbrella issue remains open.
Why this change
Lorebook authors need import/export, bulk editing and diagnostics that preserve data and matching semantics.
What changed
Validation
pnpm checkpasses locallyCONTRIBUTING.mdpnpm check; prompt regressions; 15 lorebook regressions; three desktop/mobile Chromium/WebKit browser cases; seven shell smoke cases passed. The final Windows fixture combination still requires Windows CI.
Valid findings were traced and fixed. See the current maintainer verification below for review and validation evidence.
Manual verification
Manually verify bulk edits, failed import rollback, exports and case-sensitive/regular-expression diagnostics using a representative lorebook.
Automated browser evidence does not claim physical-device or manual container verification. Human checklist states are preserved.
Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue openedAdded an Unreleased changelog entry. No release metadata or user-facing docs changed.
UI evidence
Browser evidence (download the HTML to view the embedded screenshots). Captions distinguish before/after captures from current feature screenshots.
Summary by CodeRabbit
Maintainer verification
Published
a6dc8578cresolves all four latest hosted findings. CSV/Markdown downloads now reuse the existing ASCII fallback plus UTF-8 filename* pattern, preserving spaces and non-English names with safe header encoding. Browser setup requests fail immediately on HTTP errors. The activation regression now exercises actual generation and Continue, directly checks that unknown entry IDs are not stored, and proves shutdown flushes a queued activation before storage closes and persists it after reopening.Exact-head pnpm check, export/import and real activation regressions, feature browsers 3/3, and smoke 7/7 pass. The combined integration c5410d2c2 passes pnpm check, four focused regressions, and all nine affected browser cases across desktop Chromium, mobile Chromium and mobile WebKit. The final combined local CodeRabbit delta completed with zero findings across nine files. Earlier CSV ambiguity, rollback and lint fixes remain covered.
Latest follow-up
5adb4b438fixes selected lorebooks disappearing from bulk Enable/Disable after filtering. The component submits every selected ID to the existing endpoint; Undo still uses only server-confirmedchangedIds. Removed the obsolete client planner and its implementation-only test. The retained actual browser fixture reproduces the old disabled-button failure and now verifies hidden selections, exact mutation contents, unchanged IDs, and precise Undo.For this six-file delta:
pnpm checkpasses, the targeted browser matrix passes 3/3, and shell smoke passes 7/7. Independent source review has no substantive findings. Local CodeRabbit completed with zero findings across all six changed files. No user-facing copy or styling changed.Current-head hosted CodeRabbit and GitHub checks remain merge gates. Human validation checkboxes are unchanged.
Local build and container verification
Tested commit:
5adb4b4389. Full local pnpm check passed. The full Docker image built successfully and ran with synthetic data; HTTP readiness and embedded build commit were verified. These results do not claim completion of the remaining manual and UI edge-case checklist.Interactive browser walkthroughs of the feature were completed against the running production container using synthetic fixtures, supported by focused automated browser checks. This was agent-operated browser interaction, not physical-device testing. The broader theme, empty-state and error-path checklist remains separate.
Completed UI verification
At
5adb4b4389, functional browser checks passed 3/3 across desktop Chromium, mobile Chromium and mobile WebKit. Coverage included lint warnings, scan preview, import, bulk enable/disable and undo. Two supplemental empty-lorebook views passed and were visually inspected: light desktop (1440px) and dark narrow (390px), with visible search, completed loading and no horizontal document overflow. The production-container walkthrough also verified actions on selected lorebooks hidden by filtering. These were agent-operated synthetic browser checks; no physical-device or real-provider testing is claimed.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.