[PR #8442] [MERGED] feat: search characters and personas by all entered tags #8604

Closed
opened 2026-11-07 16:45:54 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/8442
Author: @SpicyMarinara
Created: 10/29/2026
Status: ✅ Merged
Merged: 10/29/2026
Merged by: @SpicyMarinara

Base: staging ← Head: feat/8421-and-tag-search


📝 Commits (3)

  • 4a778ac feat: match all positive card search tags
  • 38db3f4 feat: apply AND tag searches before library pagination
  • aaa9ab0 fix: normalize Unicode tag separators before parsing

📊 Changes

11 files changed (+314 additions, -19 deletions)

View changed files

📝 docs/characters/library-organization.md (+3 -1)
📝 docs/characters/personas.md (+1 -1)
➕ e2e/card-tag-search.e2e.ts (+63 -0)
📝 packages/client/src/lib/card-library-search.ts (+7 -1)
📝 packages/server/src/db/file-backed-store.ts (+22 -1)
📝 packages/server/src/db/file-query.ts (+15 -0)
📝 packages/server/src/services/storage/character-catalog.ts (+8 -1)
📝 packages/server/src/services/storage/characters.storage.ts (+12 -2)
📝 packages/shared/src/utils/text-matching.ts (+14 -0)
📝 scripts/regressions/card-library-search.regression.ts (+33 -12)
➕ scripts/regressions/card-tag-search-pages.regression.ts (+136 -0)

📄 Description

Linked issue

Refs #8421 (the accepted AND-search subset). Owner: @SpicyMarinara (Codex).

Why this change

Typing male genshin currently searches for one phrase and misses cards tagged separately with both words. Dedicated include/exclude controls would take additional space in the sidebars. The existing search field can support this behavior without adding controls.

What changed

  • Character and persona searches can match every entered tag exactly, ignoring case and Unicode width differences. Separate tags with spaces or commas; quote multiword/comma-containing tags, such as male "Modern AU".
  • Matching is additive: ordinary whole-phrase/name/text search and existing tag exclusions keep working. A card may match either the existing phrase search or all entered tags.
  • Apply the same tag matcher in the sidebars, full-page libraries, and all three server list endpoints before sorting and pagination. Keep favorites and built-in filtering intact; malformed stored tags produce no tag match.
  • Document the syntax and current sidebar labels in the character and persona guides. No new filter UI, dependency, storage format, or release metadata.

Validation

Current repaired head: aaa9ab0ed74a03cbd676835fcf84e9aa1b3c62d5. Fresh checks on that head are listed below; unchanged parent-head proofs are identified explicitly.

  • pnpm install and frozen-head pnpm check passed. The existing HomeProfessorMariChat serverRun hook warning remains.

  • card-library-search.regression.ts passed: exact AND tags, spaces/commas, quotes, normalization, phrase search, exclusion precedence, and empty/malformed tag controls.

  • card-tag-search-pages.regression.ts passed against the actual Fastify routes with 113 character/persona fixtures plus malformed-data controls: matches beyond the first 100 records, limit/offset/hasMore, favorites and legacy phrase matches. The unchanged route fixture failed before the backend fix by omitting both tag matches.

  • card-tag-search.e2e.ts: 3/3 passed across desktop Chromium, mobile Chromium and mobile WebKit, covering both sidebars and full-page libraries with real APIs.

  • pnpm smoke:ui: 7/7 passed at parent 38db3f466; the repair changes only normalization before tag parsing. A combined-candidate smoke is also running before staging integration.

  • Actual file-store predicate proof: 6 result-set assertions passed over 25 rows at parent 38db3f466, including invalid JSON/shapes, missing/nonstring tags and empty terms. The storage predicate is unchanged by the parser repair.

  • Local CodeRabbit completed the initial 11-file review with 0 findings and the four-file Unicode repair delta with 0 findings. Dottore separately identified one valid separator-normalization defect on the earlier head; the fix normalizes the whole input before splitting. The added real-route regression failed before this fix and passes afterward for fullwidth commas and quotes across all three endpoints. Fresh pnpm check, both regressions and the 3/3 browser matrix passed on this repaired head.

  • Manually verify the sidebar and library searches with a personal card collection.

  • Manually verify multiword tags, ordinary name searches and existing exclusions.

  • Manually verify on a physical iPhone.

  • Build and run a container locally.

Manual verification notes

Automated browser emulation is not physical-device testing. The local Docker daemon socket is unavailable; hosted container checks remain separate evidence. CI and Dottore Review must pass before merge. Browser screenshots are being retained as temporary PR proof, outside the source tree.

Docs and release impact

Updated docs/characters/library-organization.md and docs/characters/personas.md. Translation follow-up #8443 covers all ten language packs on docs-i18n alongside the prompt-search and roster-macro documentation.

UI evidence

Synthetic fixtures from the repaired head; browser emulation only. Published PNG bytes were downloaded and verified against the local captures.

characters-library-desktop.png

personas-sidebar-mobile-webkit.png

Combined integration validation

The isolated candidate 36d951932b8f842ab8fcc0ca6eed39dfa9ec4380 (tree 1b9a234de4362682fc46983b389a5b21dc2a2b08) includes current heads #8441, #8442 and #8444. Every changed file was checked byte-for-byte against its owning PR head; all 28 file blobs match. On that combined candidate, pnpm check, pnpm regression:prompt, all 12 macro regression files, card-search and paginated-route regressions, the advanced-memory audience regression, 9/9 focused desktop/mobile Chromium/WebKit cases, and 7/7 UI smokes passed. Browser emulation and local fixture-provider checks do not establish physical-device or real-provider behavior.


🔄 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/8442 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `feat/8421-and-tag-search` --- ### 📝 Commits (3) - [`4a778ac`](https://github.com/Pasta-Devs/Marinara-Engine/commit/4a778ac28a2198196d0a39c2b9e99219c7dd2402) feat: match all positive card search tags - [`38db3f4`](https://github.com/Pasta-Devs/Marinara-Engine/commit/38db3f466ba4d63ecde8d8006914f3711124da68) feat: apply AND tag searches before library pagination - [`aaa9ab0`](https://github.com/Pasta-Devs/Marinara-Engine/commit/aaa9ab0ed74a03cbd676835fcf84e9aa1b3c62d5) fix: normalize Unicode tag separators before parsing ### 📊 Changes **11 files changed** (+314 additions, -19 deletions) <details> <summary>View changed files</summary> 📝 `docs/characters/library-organization.md` (+3 -1) 📝 `docs/characters/personas.md` (+1 -1) ➕ `e2e/card-tag-search.e2e.ts` (+63 -0) 📝 `packages/client/src/lib/card-library-search.ts` (+7 -1) 📝 `packages/server/src/db/file-backed-store.ts` (+22 -1) 📝 `packages/server/src/db/file-query.ts` (+15 -0) 📝 `packages/server/src/services/storage/character-catalog.ts` (+8 -1) 📝 `packages/server/src/services/storage/characters.storage.ts` (+12 -2) 📝 `packages/shared/src/utils/text-matching.ts` (+14 -0) 📝 `scripts/regressions/card-library-search.regression.ts` (+33 -12) ➕ `scripts/regressions/card-tag-search-pages.regression.ts` (+136 -0) </details> ### 📄 Description ## Linked issue Refs #8421 (the accepted AND-search subset). Owner: @SpicyMarinara (Codex). ## Why this change Typing `male genshin` currently searches for one phrase and misses cards tagged separately with both words. Dedicated include/exclude controls would take additional space in the sidebars. The existing search field can support this behavior without adding controls. ## What changed - Character and persona searches can match every entered tag exactly, ignoring case and Unicode width differences. Separate tags with spaces or commas; quote multiword/comma-containing tags, such as `male "Modern AU"`. - Matching is additive: ordinary whole-phrase/name/text search and existing tag exclusions keep working. A card may match either the existing phrase search or all entered tags. - Apply the same tag matcher in the sidebars, full-page libraries, and all three server list endpoints before sorting and pagination. Keep favorites and built-in filtering intact; malformed stored tags produce no tag match. - Document the syntax and current sidebar labels in the character and persona guides. No new filter UI, dependency, storage format, or release metadata. ## Validation Current repaired head: `aaa9ab0ed74a03cbd676835fcf84e9aa1b3c62d5`. Fresh checks on that head are listed below; unchanged parent-head proofs are identified explicitly. - `pnpm install` and frozen-head `pnpm check` passed. The existing HomeProfessorMariChat `serverRun` hook warning remains. - `card-library-search.regression.ts` passed: exact AND tags, spaces/commas, quotes, normalization, phrase search, exclusion precedence, and empty/malformed tag controls. - `card-tag-search-pages.regression.ts` passed against the actual Fastify routes with 113 character/persona fixtures plus malformed-data controls: matches beyond the first 100 records, limit/offset/hasMore, favorites and legacy phrase matches. The unchanged route fixture failed before the backend fix by omitting both tag matches. - `card-tag-search.e2e.ts`: 3/3 passed across desktop Chromium, mobile Chromium and mobile WebKit, covering both sidebars and full-page libraries with real APIs. - `pnpm smoke:ui`: 7/7 passed at parent `38db3f466`; the repair changes only normalization before tag parsing. A combined-candidate smoke is also running before staging integration. - Actual file-store predicate proof: 6 result-set assertions passed over 25 rows at parent `38db3f466`, including invalid JSON/shapes, missing/nonstring tags and empty terms. The storage predicate is unchanged by the parser repair. - Local CodeRabbit completed the initial 11-file review with 0 findings and the four-file Unicode repair delta with 0 findings. Dottore separately identified one valid separator-normalization defect on the earlier head; the fix normalizes the whole input before splitting. The added real-route regression failed before this fix and passes afterward for fullwidth commas and quotes across all three endpoints. Fresh pnpm check, both regressions and the 3/3 browser matrix passed on this repaired head. - [ ] Manually verify the sidebar and library searches with a personal card collection. - [ ] Manually verify multiword tags, ordinary name searches and existing exclusions. - [ ] Manually verify on a physical iPhone. - [ ] Build and run a container locally. ### Manual verification notes Automated browser emulation is not physical-device testing. The local Docker daemon socket is unavailable; hosted container checks remain separate evidence. CI and Dottore Review must pass before merge. Browser screenshots are being retained as temporary PR proof, outside the source tree. ## Docs and release impact Updated `docs/characters/library-organization.md` and `docs/characters/personas.md`. Translation follow-up #8443 covers all ten language packs on `docs-i18n` alongside the prompt-search and roster-macro documentation. ## UI evidence Synthetic fixtures from the repaired head; browser emulation only. Published PNG bytes were downloaded and verified against the local captures. ![characters-library-desktop.png](https://gist.githubusercontent.com/SpicyMarinara/0e836773d7c997fa14d17b636db69d37/raw/0bb1c02fa736a1d3fed65e9c4ab3b85bdec4f5d3/characters-library-desktop.png) ![personas-sidebar-mobile-webkit.png](https://gist.githubusercontent.com/SpicyMarinara/0e836773d7c997fa14d17b636db69d37/raw/ab0febe57ed433ec56a9c47fd9294554246c5b74/personas-sidebar-mobile-webkit.png) ## Combined integration validation The isolated candidate `36d951932b8f842ab8fcc0ca6eed39dfa9ec4380` (tree `1b9a234de4362682fc46983b389a5b21dc2a2b08`) includes current heads #8441, #8442 and #8444. Every changed file was checked byte-for-byte against its owning PR head; all 28 file blobs match. On that combined candidate, `pnpm check`, `pnpm regression:prompt`, all 12 macro regression files, card-search and paginated-route regressions, the advanced-memory audience regression, 9/9 focused desktop/mobile Chromium/WebKit cases, and 7/7 UI smokes passed. Browser emulation and local fixture-provider checks do not establish physical-device or real-provider behavior. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 16:45:54 +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#8604
No description provided.