[PR #972] [MERGED] feat(client): allow multiple included tags with OR logic and match ranking #4863

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/972
Author: @ghost
Created: 5/18/2026
Status: ✅ Merged
Merged: 5/19/2026
Merged by: @cha1latte

Base: staging ← Head: staging


📝 Commits (3)

  • adc8848 feat(client): allow multiple included tags with OR logic and match ranking
  • d7af7c6 fix(client - char panel): optimize tag filter with pre-computed lowercase set and add sort tie-breaker
  • 72476e2 fix(client - char panel): remove tag from includedTags when excluding to prevent empty results

📊 Changes

1 file changed (+91 additions, -20 deletions)

View changed files

📝 packages/client/src/components/panels/CharactersPanel.tsx (+91 -20)

📄 Description

Linked issue

Closes #971

Why this change

The character list panel only allowed filtering by a single tag. When a user clicked a different tag, it replaced the previous selection rather than adding to it. This is a limitation for users who want to search for characters with some specific tags.

What changed

  • Changed activeTag: string | null to includedTags: Set<string> for multi-select support
  • Filter logic uses OR semantics: a character appears if it has at least one matching selected tag
  • Sorting ranks characters by tag match count (more matching tags = higher in list) when included tags are active
  • Excluded tags behavior unchanged — still fully removes matching characters before other filtering
  • UI display updated to show first 3 selected tags with +N overflow (e.g., "tag1 · tag2 · tag3 · +2")

Validation

  • pnpm check passes locally
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

  1. Opened Characters panel
  2. Clicked Tags filter bar to expand tag list
  3. Selected multiple tags (tag1, tag2, tag3) — all showed as highlighted
  4. Verified filter bar displayed "tag1 · tag2 · tag3" with correct styling
  5. Selected 4th tag — saw "+1" overflow indicator appear
  6. Verified characters with multiple matching tags appear higher in sorted list
  7. Tested exclude tags still work independently
  8. Verified "Clear" button resets both included and excluded tags

Docs and release impact

  • No docs changes needed

UI evidence (if applicable)

msedge_L56t48rutf

Summary by CodeRabbit

  • New Features
    • Multi-tag filtering: select multiple tags; characters are shown if they match any selected tag.
    • Smart sorting: characters matching more of your selected tags rank higher across all sort orders.
    • Updated tag filter UI: compact summaries show up to 3 included tags plus “+N” and display excluded counts.
    • Tag pill behavior: visual highlighting and deletion now reflect included/excluded tag state consistently.

Review Change Stack


🔄 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/972 **Author:** [@ghost](https://github.com/ghost) **Created:** 5/18/2026 **Status:** ✅ Merged **Merged:** 5/19/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `staging` ← **Head:** `staging` --- ### 📝 Commits (3) - [`adc8848`](https://github.com/Pasta-Devs/Marinara-Engine/commit/adc884830e5bc89902911079100098ece00184a0) feat(client): allow multiple included tags with OR logic and match ranking - [`d7af7c6`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d7af7c682935ab4da3d8726f037255ca6f4901dc) fix(client - char panel): optimize tag filter with pre-computed lowercase set and add sort tie-breaker - [`72476e2`](https://github.com/Pasta-Devs/Marinara-Engine/commit/72476e22935bb95e13f5c39e471875bbdf991a6b) fix(client - char panel): remove tag from includedTags when excluding to prevent empty results ### 📊 Changes **1 file changed** (+91 additions, -20 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/panels/CharactersPanel.tsx` (+91 -20) </details> ### 📄 Description ## Linked issue Closes #971 ## Why this change The character list panel only allowed filtering by a single tag. When a user clicked a different tag, it replaced the previous selection rather than adding to it. This is a limitation for users who want to search for characters with some specific tags. ## What changed - Changed `activeTag: string | null` to `includedTags: Set<string>` for multi-select support - Filter logic uses OR semantics: a character appears if it has at least one matching selected tag - Sorting ranks characters by tag match count (more matching tags = higher in list) when included tags are active - Excluded tags behavior unchanged — still fully removes matching characters before other filtering - UI display updated to show first 3 selected tags with +N overflow (e.g., "tag1 · tag2 · tag3 · +2") ## Validation - [x] `pnpm check` passes locally - [x] Ran the app, clicked through the changes manually - [x] Checked edge cases (light + dark mode, mobile viewport) - [x] Above manual verification completed (describe below) - [x] Read and followed `CONTRIBUTING.md` ### Manual verification notes 1. Opened Characters panel 2. Clicked Tags filter bar to expand tag list 3. Selected multiple tags (tag1, tag2, tag3) — all showed as highlighted 4. Verified filter bar displayed "tag1 · tag2 · tag3" with correct styling 5. Selected 4th tag — saw "+1" overflow indicator appear 6. Verified characters with multiple matching tags appear higher in sorted list 7. Tested exclude tags still work independently 8. Verified "Clear" button resets both included and excluded tags ## Docs and release impact - [x] No docs changes needed ## UI evidence (if applicable) <img width="353" height="829" alt="msedge_L56t48rutf" src="https://github.com/user-attachments/assets/6376939b-3b26-487e-95ac-3ccc35d6e4b4" /> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Multi-tag filtering: select multiple tags; characters are shown if they match any selected tag. * Smart sorting: characters matching more of your selected tags rank higher across all sort orders. * Updated tag filter UI: compact summaries show up to 3 included tags plus “+N” and display excluded counts. * Tag pill behavior: visual highlighting and deletion now reflect included/excluded tag state consistently. <!-- review_stack_entry_start --> [![Review Change Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/Pasta-Devs/Marinara-Engine/pull/972?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack) <!-- review_stack_entry_end --> <!-- 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:11:16 +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#4863
No description provided.