mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #312] [MERGED] feat(client): Knowledge Router UX polish + theme-aware Knowledge Sources #4557
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#4557
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/312
Author: @cha1latte
Created: 4/29/2026
Status: ✅ Merged
Merged: 5/3/2026
Merged by: @SpicyMarinara
Base:
main← Head:feat/knowledge-router-ux-polish📝 Commits (5)
47868fefeat(client): Knowledge Router UX polish + theme-aware Knowledge Sources0308a75fix(client): tighten "both agents" warning + dedupe lorebook IDs31f386afix(client): handle zero-entry and fetch-error states in coverage badge541b02cfix(client): gate warning on enabled rows + tighten hook API on error9f9c9d0Merge branch 'main' into feat/knowledge-router-ux-polish📊 Changes
2 files changed (+150 additions, -8 deletions)
View changed files
📝
packages/client/src/components/agents/AgentEditor.tsx(+111 -7)📝
packages/client/src/hooks/use-lorebooks.ts(+39 -1)📄 Description
Part 3 of #226 — the UX layer for the Knowledge Router agent merged in #228.
Summary
Adds three small UX improvements to make the Knowledge Router agent (#228) easier to configure and harder to misuse:
Plus an earned scope-creep fix: the wider Knowledge Sources section was using hard-coded white-on-X colors that washed out completely in light mode, making the lorebook picker invisible to half the user base. Now uses theme-aware CSS variables.
Why
PR #228 shipped the Knowledge Router agent itself, but left the UX surface bare:
This PR fills those gaps so users can actually use the agent confidently.
Architecture
47868feuseEntriesAcrossLorebookshook + 3 UX pieces in AgentEditor + theme-aware Knowledge SourcesHow each piece works
Description-coverage badge:
useEntriesAcrossLorebooks(new hook) to batch-fetch entries via TanStack Query'suseQueries— each per-lorebook query is cached independently(entries with non-empty description) / (total entries), displays as colored dot + "X% described (Y/Z)" text"Both agents enabled" warning banner:
agentConfigscontains a row for the other knowledge agentTip text:
Theme-aware Knowledge Sources fix:
text-white/Xandbg-white/[0.02]throughout the section withtext-[var(--muted-foreground)],bg-[var(--secondary)], and similar theme-adaptive CSS variablesKnown limitations
Test plan
Manual smoke tests on the dual-install dev environment (port 7820), Roleplay chat, with
GhostfaceandApollotest lorebooks (10 + 11 entries, 0% description coverage):pnpm checkpasses locallyScreenshots
Dark mode — Router editor with Ghostface selected (badge + tip visible)

Light mode — Router editor with Ghostface selected (badge + tip visible after theme fix)

Warning banner at top of either KR or Router editor when both are configured

Mobile viewport (~400px) — Knowledge Sources section + warning banner wrapping cleanly

Summary by CodeRabbit
New Features
Style
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.