mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #4558] [CLOSED] experiment: charlib #6421
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#6421
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/4558
Author: @Gunterlie
Created: 8/4/2026
Status: ❌ Closed
Base:
staging← Head:all-my-little-piggies📝 Commits (6)
3831f58feat(characters): bulk operations and manager views in the full character libraryeed74d6Add tag filtering and manager to character library9d0195aRework character library selection and filters1eb3fc1Extract shared character library card model and filter pipeline7aa66f3Add group filtering, per-card actions and persisted view state to the library69358cfGive Professor Mari a library digest so she can curate characters📊 Changes
20 files changed (+3055 additions, -520 deletions)
View changed files
📝
docs/characters/library-organization.md(+51 -0)📝
package.json(+2 -1)➕
packages/client/src/components/characters/CharacterBulkEditModal.tsx(+341 -0)📝
packages/client/src/components/characters/CharacterLibraryView.tsx(+1288 -199)➕
packages/client/src/components/characters/CharacterTagManagerModal.tsx(+346 -0)📝
packages/client/src/components/panels/CharactersPanel.tsx(+58 -223)📝
packages/client/src/hooks/use-characters.ts(+19 -0)➕
packages/client/src/lib/card-library-filter.ts(+153 -0)📝
packages/client/src/lib/card-library-search.ts(+29 -0)➕
packages/client/src/lib/character-library-card.ts(+219 -0)📝
packages/client/src/lib/character-token-count.ts(+8 -91)📝
packages/client/src/localization/locales/en.json(+3 -0)📝
packages/client/src/stores/ui.store.ts(+30 -0)📝
packages/server/src/routes/characters.routes.ts(+52 -0)📝
packages/server/src/routes/generate/professor-mari-prompt-context.ts(+35 -6)📝
packages/shared/src/index.ts(+2 -0)➕
packages/shared/src/utils/character-bulk-tags.ts(+52 -0)➕
packages/shared/src/utils/character-card-health.ts(+145 -0)📝
scripts/regressions/card-library-search.regression.ts(+161 -0)➕
scripts/regressions/character-bulk-edit.regression.ts(+61 -0)📄 Description
Why
The character library is already feature-rich, but the two character surfaces had drifted into parallel implementations:
CharactersPanel.tsx(sidebar) — folders, drag-drop, duplicate, import-metadata badge, tag-match-count sort tiebreakCharacterLibraryView.tsx(full library) — grid/table, density, bulk edit, tag manager, keyboard nav, no grouping at allThey duplicated
parseCharacterRow,getCharacterTags, the sort switch, the tag filter loop,allTagsand the scroll-restore block — and the copies had already diverged in behaviour. Every new feature cost two implementations.This is an experiment at closing that gap and building a real manager layer on top, reusing plumbing that already ships rather than adding infrastructure.
What changed
1. Shared card model and filter pipeline (
1eb3fc1)New
lib/character-library-card.ts(card model, group parsing,computeGroupMembershipUpdates) andlib/card-library-filter.ts(filter/sort/tag helpers). Both surfaces now run through them.Two deliberate behaviour convergences, called out because they are not no-ops:
tagMatch: "any"option. The sidebar widens on multiple tags where the library narrows; unifying these silently would have changed filtering under existing users.2. Groups, per-card actions, persisted view state (
7aa66f3)character_groupsstays one table serving both the library's grouping and the chat/game wizards' party presets (ChatSetupWizard,GameSetupWizard,NoodleHome). No schema change, no migration. Akinddiscriminator would have needed a backfill default, and getting it wrong makes existing party presets vanish from the wizards.3. Professor Mari as librarian (
69358cf)Mari already had
update_character— it patches tags, favourite and every card field, with version snapshots and acharacter_updatedevent. What she lacked was sight: her prompt context handed her a bare comma-joined list of names.Her character list now carries one digest line per card —
name [tags] ~tokens needs: gaps. That is the whole change. No new command types, no approval renderer, no changes to the 2,841-line workspace agent. Libraries over 200 characters fall back to plain names so the digest cannot crowd out the context window.Token estimation moved into
packages/shared(re-exported from the old client path, so no import sites changed) alongside a newgetCardHealthIssues.Scope notes
CharacterPanelRowmerge in the original plan was dropped. The two sidebar card copies were expected to differ by one button; on reading they differ in avatar size, text scale, DOM element choice, data attributes, and the actions block isflexwith four icons in one andgrid-cols-3 w-24with a labelled chat button in the other. Merging would mean a props union reproducing both branches. Left alone./generate/raw/embeddings,localEmbed,cosineSimilarity) but vectors need somewhere to live, and substring search still covers real library sizes.folder→groupcopy rename was skipped — pure vocabulary churn across every locale file for no functional gain.Incidental fix
Root-level character rows in the sidebar had
onClickbut norole/tabIndex/onKeyDown, so they were mouse-only while folder members were keyboard-accessible. Root is where most characters live.Automated checks run
pnpm check(TypeScript + ESLint + localization + build) — passingpnpm regression:card-library-search— extended with asserts on the filter/sort pipeline, AND-vs-OR tag semantics, group membership updates, and card healthpnpm regression:chat-resource-drop— the drag payload path the sidebar rewrite touchespnpm regression:character-bulk-edit,pnpm regression:localization— passingTest plan — needs manual verification
Nothing below has been verified in a browser. These are to-dos, not results.
ChatSetupWizardandGameSetupWizardcharacter_updatedevents fire and version snapshots are createdLinked issue
No issue or feature request is linked. Per
CONTRIBUTING.md § Before You Open a Pull Requestone should be opened before this is considered for merge — flagging rather than silently skipping, especially as this is exploratory.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.