[PR #8905] [MERGED] perf(characters): filters and folders that work in large libraries #8874

Closed
opened 2026-11-07 17:40:23 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/8905
Author: @Gunterlie
Created: 11/6/2026
Status: ✅ Merged
Merged: 11/6/2026
Merged by: @Gunterlie

Base: staging ← Head: perf/feel-2-large-libraries


📝 Commits (6)

  • 3d5ab9a perf(characters): filter tags and folders on the server for large libraries
  • 715d86c fix(characters): complete filtered folders and stop auto-load loops
  • 92f4f9a fix(client): show folder members loading and error state
  • a785716 fix(client): show folder load status above the folder list
  • 075d4c9 fix(client): show folder load status inside the opened folder
  • 0c6bd14 fix(client): render folder load status only in the open folder

📊 Changes

11 files changed (+301 additions, -57 deletions)

View changed files

📝 packages/client/src/components/characters/CharacterLibraryView.tsx (+15 -1)
📝 packages/client/src/components/panels/CharactersPanel.tsx (+55 -18)
📝 packages/client/src/components/panels/LorebooksPanel.tsx (+1 -0)
📝 packages/client/src/components/panels/PanelLoadMoreBar.tsx (+44 -12)
📝 packages/client/src/components/panels/PersonasPanel.tsx (+1 -0)
📝 packages/client/src/hooks/use-characters.ts (+87 -24)
📝 packages/client/src/localization/locales/en.json (+3 -0)
📝 packages/server/src/routes/characters.routes.ts (+11 -0)
📝 packages/server/src/services/storage/character-catalog.ts (+54 -1)
📝 packages/shared/src/types/character-catalog.ts (+4 -0)
📝 scripts/regressions/card-tag-search-pages.regression.ts (+26 -1)

📄 Description

Part of #8904.

Why

A user on Discord reported that the character library loads 100 cards per page, needs many "Load more" clicks, and that filters seem to miss cards. Text search already ran on the server, but tag chips, excluded tags, folder contents and counts only looked at the pages already loaded. In a large library this looks broken: a tag filter shows a handful of cards, a folder that says 40 shows 12, and folder members use up root page slots.

What changed

  • Server catalog accepts tag / excludeTag (repeatable, case-insensitive; cards with more matching tags rank first, the same order the panel already used) and folder=<id>|none|any, and returns total and favoriteFolderIds (folders holding a matching favourite, for the favourite sort).
  • New GET /api/characters/catalog/tags lists every tag, so the filter chips do not depend on loaded pages.
  • The Characters panel sends its tag filters to the server. The root list skips folder members. Without filters, an open folder loads all of its own members; while filtering, one request loads every matching folder member, so filtered folders are complete.
  • Folder create/rename/move/delete also refresh the card list (the root list depends on folder membership now).
  • The panel lists and the full library load the next page when the end of the list comes near. Auto-load pauses after a failed page; the button stays for keyboard use and retries.
  • Load-more reads "Load more (N of total)" for characters.

Personas have the same folder problem; that is a follow-up.

Proof

  • card-tag-search-pages regression extended: tag OR filter with totals, ranking by match count, excluded tags, folder=none, folder=<id>, folder=any, favourite folders and the tag list.
  • Dev Mari numbers (3,000 cards, 300-card folder) follow in a comment.

Manual verification

  • Manually verify a rare tag chip in the Characters panel finds all matching cards in a library with more than 100 cards.
  • Manually verify excluding a tag hides cards on pages that were not loaded yet.
  • Manually verify an open folder shows all of its cards, and the root list does not show folder members.
  • Manually verify dragging a card into or out of a folder updates both the folder and the root list.
  • Manually verify scrolling to the end of the panel and the full library loads the next page without a click, and the button still works.
  • Manually verify folders show all of their matching cards while a tag filter is active.
  • Manually verify the favourite sort puts folders with a favourite first, also when they are collapsed.

🔄 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/8905 **Author:** [@Gunterlie](https://github.com/Gunterlie) **Created:** 11/6/2026 **Status:** ✅ Merged **Merged:** 11/6/2026 **Merged by:** [@Gunterlie](https://github.com/Gunterlie) **Base:** `staging` ← **Head:** `perf/feel-2-large-libraries` --- ### 📝 Commits (6) - [`3d5ab9a`](https://github.com/Pasta-Devs/Marinara-Engine/commit/3d5ab9a816ea9c307494b29bc913c7c84cfddfb0) perf(characters): filter tags and folders on the server for large libraries - [`715d86c`](https://github.com/Pasta-Devs/Marinara-Engine/commit/715d86c42c2d9db83c62b07ff8889a7c54f80e06) fix(characters): complete filtered folders and stop auto-load loops - [`92f4f9a`](https://github.com/Pasta-Devs/Marinara-Engine/commit/92f4f9a679c29bd285c2799142db8f81679acd59) fix(client): show folder members loading and error state - [`a785716`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a785716267c38bab86f2418fe111a50b9ab3c6d3) fix(client): show folder load status above the folder list - [`075d4c9`](https://github.com/Pasta-Devs/Marinara-Engine/commit/075d4c972d6663b341caca67f2d50eb435acf200) fix(client): show folder load status inside the opened folder - [`0c6bd14`](https://github.com/Pasta-Devs/Marinara-Engine/commit/0c6bd14a1e80b5ad4a51e2133d295b787e14204c) fix(client): render folder load status only in the open folder ### 📊 Changes **11 files changed** (+301 additions, -57 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/characters/CharacterLibraryView.tsx` (+15 -1) 📝 `packages/client/src/components/panels/CharactersPanel.tsx` (+55 -18) 📝 `packages/client/src/components/panels/LorebooksPanel.tsx` (+1 -0) 📝 `packages/client/src/components/panels/PanelLoadMoreBar.tsx` (+44 -12) 📝 `packages/client/src/components/panels/PersonasPanel.tsx` (+1 -0) 📝 `packages/client/src/hooks/use-characters.ts` (+87 -24) 📝 `packages/client/src/localization/locales/en.json` (+3 -0) 📝 `packages/server/src/routes/characters.routes.ts` (+11 -0) 📝 `packages/server/src/services/storage/character-catalog.ts` (+54 -1) 📝 `packages/shared/src/types/character-catalog.ts` (+4 -0) 📝 `scripts/regressions/card-tag-search-pages.regression.ts` (+26 -1) </details> ### 📄 Description Part of #8904. ## Why A user on Discord reported that the character library loads 100 cards per page, needs many "Load more" clicks, and that filters seem to miss cards. Text search already ran on the server, but tag chips, excluded tags, folder contents and counts only looked at the pages already loaded. In a large library this looks broken: a tag filter shows a handful of cards, a folder that says 40 shows 12, and folder members use up root page slots. ## What changed - Server catalog accepts `tag` / `excludeTag` (repeatable, case-insensitive; cards with more matching tags rank first, the same order the panel already used) and `folder=<id>|none|any`, and returns `total` and `favoriteFolderIds` (folders holding a matching favourite, for the favourite sort). - New `GET /api/characters/catalog/tags` lists every tag, so the filter chips do not depend on loaded pages. - The Characters panel sends its tag filters to the server. The root list skips folder members. Without filters, an open folder loads all of its own members; while filtering, one request loads every matching folder member, so filtered folders are complete. - Folder create/rename/move/delete also refresh the card list (the root list depends on folder membership now). - The panel lists and the full library load the next page when the end of the list comes near. Auto-load pauses after a failed page; the button stays for keyboard use and retries. - Load-more reads "Load more (N of total)" for characters. Personas have the same folder problem; that is a follow-up. ## Proof - `card-tag-search-pages` regression extended: tag OR filter with totals, ranking by match count, excluded tags, `folder=none`, `folder=<id>`, `folder=any`, favourite folders and the tag list. - Dev Mari numbers (3,000 cards, 300-card folder) follow in a comment. ## Manual verification - [ ] Manually verify a rare tag chip in the Characters panel finds all matching cards in a library with more than 100 cards. - [ ] Manually verify excluding a tag hides cards on pages that were not loaded yet. - [ ] Manually verify an open folder shows all of its cards, and the root list does not show folder members. - [ ] Manually verify dragging a card into or out of a folder updates both the folder and the root list. - [ ] Manually verify scrolling to the end of the panel and the full library loads the next page without a click, and the button still works. - [ ] Manually verify folders show all of their matching cards while a tag filter is active. - [ ] Manually verify the favourite sort puts folders with a favourite first, also when they are collapsed. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 17:40:23 +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#8874
No description provided.