[PR #358] [MERGED] feat: Active filter tab for Lorebooks panel #4578

Closed
opened 2026-10-22 04:08:52 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/358
Author: @kevin-ho
Created: 5/2/2026
Status: ✅ Merged
Merged: 5/3/2026
Merged by: @SpicyMarinara

Base: main ← Head: feat/active-lorebook-filter


📝 Commits (2)

  • 927547c feat: Active lorebook filter includes character/persona/chat-scoped books
  • bf01f09 fix: wrap metadata JSON.parse in try-catch in active lorebook filter

📊 Changes

1 file changed (+36 additions, -4 deletions)

View changed files

📝 packages/client/src/components/panels/LorebooksPanel.tsx (+36 -4)

📄 Description

Linked issue

Closes #357

Why this change

Lorebook collections grow quickly, making the panel hard to navigate. Users want to review or edit entries that are actively injecting into their current chat, but there's no way to see which lorebooks are in play without scrolling through the entire list and manually checking each book's attachment point.

What changed

  • Added an "Active" category tab to the Lorebooks panel (between "All" and "World", Zap icon) that filters to only lorebooks participating in the active chat's prompt assembly
  • Filter mirrors server-side filterRelevantLorebooks() — matches on chat-pinned (activeLorebookIds), character-linked, persona-linked, and chat-scoped lorebooks
  • Single file change: packages/client/src/components/panels/LorebooksPanel.tsx

Validation

  • pnpm check passes locally (0 errors, 1 pre-existing unrelated warning in GameNarration.tsx)
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

  • Verified Active tab shows lorebooks pinned via chat settings
  • Verified Active tab shows lorebooks linked to the active character card
  • Verified Active tab shows lorebooks linked to the active persona
  • Verified Active tab shows lorebooks scoped to the chat
  • Verified switching chats updates the filtered list correctly
  • Verified no active chat selected shows empty state with no errors
  • Verified light/dark mode renders correctly
  • Verified mobile viewport — tab wraps naturally with flex-wrap

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Version/release files updated (only if this PR includes a version bump)

UI evidence (if applicable)

image

Summary by CodeRabbit

  • New Features
    • Added an "Active" category tab to the lorebooks panel to quickly view lorebooks relevant to your current chat context, including those connected to your active character, persona, and chat.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/358 **Author:** [@kevin-ho](https://github.com/kevin-ho) **Created:** 5/2/2026 **Status:** ✅ Merged **Merged:** 5/3/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `main` ← **Head:** `feat/active-lorebook-filter` --- ### 📝 Commits (2) - [`927547c`](https://github.com/Pasta-Devs/Marinara-Engine/commit/927547c42a85f8f5ba929e36b94f08a1d12f166e) feat: Active lorebook filter includes character/persona/chat-scoped books - [`bf01f09`](https://github.com/Pasta-Devs/Marinara-Engine/commit/bf01f09f0b97641d36f69606ee258ccc4d96adbb) fix: wrap metadata JSON.parse in try-catch in active lorebook filter ### 📊 Changes **1 file changed** (+36 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/panels/LorebooksPanel.tsx` (+36 -4) </details> ### 📄 Description ## Linked issue Closes #357 ## Why this change Lorebook collections grow quickly, making the panel hard to navigate. Users want to review or edit entries that are actively injecting into their current chat, but there's no way to see which lorebooks are in play without scrolling through the entire list and manually checking each book's attachment point. ## What changed - Added an **"Active"** category tab to the Lorebooks panel (between "All" and "World", Zap icon) that filters to only lorebooks participating in the active chat's prompt assembly - Filter mirrors server-side `filterRelevantLorebooks()` — matches on chat-pinned (`activeLorebookIds`), character-linked, persona-linked, and chat-scoped lorebooks - Single file change: `packages/client/src/components/panels/LorebooksPanel.tsx` ## Validation - [x] `pnpm check` passes locally (0 errors, 1 pre-existing unrelated warning in GameNarration.tsx) - [x] Container (Docker / Podman) built and ran without issue - [x] Ran the app, clicked through the changes manually - [x] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [x] Above manual verification completed (describe below) - [x] Read and followed `CONTRIBUTING.md` ### Manual verification notes - Verified Active tab shows lorebooks pinned via chat settings - Verified Active tab shows lorebooks linked to the active character card - Verified Active tab shows lorebooks linked to the active persona - Verified Active tab shows lorebooks scoped to the chat - Verified switching chats updates the filtered list correctly - Verified no active chat selected shows empty state with no errors - Verified light/dark mode renders correctly - Verified mobile viewport — tab wraps naturally with flex-wrap ## Docs and release impact - [x] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence (if applicable) <img width="726" height="152" alt="image" src="https://github.com/user-attachments/assets/2997ab7b-3bd5-4bf0-b1ff-ca2a57624678" /> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added an "Active" category tab to the lorebooks panel to quickly view lorebooks relevant to your current chat context, including those connected to your active character, persona, and chat. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:08:52 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#4578
No description provided.