Skip to content

fix(tags): make the tag filter's search find what it shows - #8692

Draft
talissoncosta wants to merge 1 commit into
mainfrom
fix/tag-filter-search
Draft

talissoncosta wants to merge 1 commit into
mainfrom
fix/tag-filter-search

Conversation

@talissoncosta

@talissoncosta talissoncosta commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor
  • I have read the Contributing Guide.
  • I have added information to docs/ if required so people know about the feature.
  • I have filled in the "Changes" section below.
  • I have filled in the "How did you test this code" section below.

Changes

Closes #8691

The filter lowercased each tag's label but not what was typed, so a tag displayed as "Onboarding" could only be found by typing onboarding. Typed as it appears, it returned nothing. The term is lowercased and trimmed once instead, so a trailing space no longer empties the list either.

The archived and untagged rows are not tags and rendered whatever was typed, so a search matching neither still showed them above an empty list, or beside a "No tags" message. They match the search now, and the empty state accounts for them.

Also drops flagGatedTags?.filter((tag) => tag), which filtered an array by the truthiness of its own elements.

Found while working on #8465 and pulled out of #8689, which wants to stay a colour change. The two touch different parts of this file and rebase cleanly either way, so the merge order does not matter.

How did you test this code?

The match predicate is extracted to tagFilterSearch.ts and covered by 12 cases in __tests__/tagFilterSearch.test.ts, including the capital that caused the bug, a trailing space, and an active filter surviving a search that does not match it.

Typecheck at main's baseline, 890 errors both sides.

Manually, on the features list with at least one tag whose name starts with a capital:

  1. Open the Tags filter and type the name as it is displayed. The tag appears.
  2. Type it in lower case. Same result.
  3. Add a trailing space. Still there.
  4. Type something matching no tag, such as zzz. The list is empty, "No tags" shows, and the archived and untagged rows are gone.
  5. Turn the archived filter on, then type zzz again. The archived row stays, because an active filter you cannot see is a filter you cannot turn off.
  6. Type arch. Only the archived row shows.
  7. Clear the box. Everything is back.

@talissoncosta
talissoncosta requested a review from a team as a code owner October 7, 2026 13:04
@talissoncosta
talissoncosta requested review from kyle-ssg and removed request for a team October 7, 2026 13:04
@vercel

vercel Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
flagsmith-frontend-preview Ready Ready Preview Oct 7, 2026 1:33pm UTC
flagsmith-frontend-staging Ready Ready Preview Oct 7, 2026 1:33pm UTC
1 Skipped Deployment
Project Deployment Actions Updated
docs Ignored Ignored Preview Oct 7, 2026 1:33pm UTC

Request Review

@github-actions github-actions Bot added the front-end Issue related to the React Front End Dashboard label Oct 7, 2026
@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Docker builds report

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-api-test:pr-8692 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-e2e:pr-8692 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-api:pr-8692 Finished ✅ Results ✅
ghcr.io/flagsmith/flagsmith:pr-8692 Finished ✅ Results ✅
ghcr.io/flagsmith/flagsmith-private-cloud:pr-8692 Finished ✅ Results ✅
ghcr.io/flagsmith/flagsmith-frontend:pr-8692 Finished ✅ Results ✅

@github-actions github-actions Bot added the fix label Oct 7, 2026
@talissoncosta
talissoncosta marked this pull request as draft October 7, 2026 13:04
@coderabbitai

coderabbitai Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
📝 Walkthrough

Walkthrough

The tag filter trims and lowercases search text before matching tag labels. The archived and untagged rows now appear only when their labels match the search. The “No tags” message is hidden when either special row is visible. The untagged row uses a named empty-string ID. The special-row and tag-list Tag components no longer receive selection styling props, and TagContent receives the tag’s disabled state.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~8 minutes

Severity of issue fixed: Low

Merge Risk: 🔵 Low · up to 062e0

Search matching has no confirmed defect, but the extra prop should be removed to keep the component type-correct.

  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor
✅ private-cloud · depot-ubuntu-latest-arm-16 — run #21303 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-arm-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  38.2 seconds
commit  062e086
info  🔄 Run: #21303 (attempt 1)

🗂️ Previous results
✅ private-cloud · depot-ubuntu-latest-16 — run #21303 (attempt 1)

Playwright Test Results (private-cloud - depot-ubuntu-latest-16)

passed  2 passed

Details

stats  2 tests across 2 suites
duration  32.9 seconds
commit  062e086
info  🔄 Run: #21303 (attempt 1)

✅ oss · depot-ubuntu-latest-arm-16 — run #21303 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-arm-16)

passed  1 passed

Details

stats  1 test across 1 suite
duration  38.3 seconds
commit  062e086
info  🔄 Run: #21303 (attempt 1)

✅ oss · depot-ubuntu-latest-16 — run #21303 (attempt 1)

Playwright Test Results (oss - depot-ubuntu-latest-16)

passed  20 passed
skipped  2 skipped

Details

stats  22 tests across 14 suites
duration  1 minute, 6 seconds
commit  062e086
info  🔄 Run: #21303 (attempt 1)

Skipped tests

firefox › tests/flag-dependencies-test.pw.ts › Flag Dependencies › A flag can be gated behind another, and says so on both sides @oss
firefox › tests/onboarding-tests.pw.ts › Onboarding › New user connects via the single-page onboarding flow @oss

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 286eb5d2-4edc-4b1f-9977-114824431044
📥 Commits

Reviewing files that changed from the base of the PR and between 76c4802 and 062e086.

📒 Files selected for processing (1)
  • frontend/web/components/tables/TableTagFilter.tsx

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

className='px-2 py-2 mr-1'
tag={tag}
/>
<Tag key={tag.id} isDot tag={tag} />

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

#!/bin/bash
# Check whether TagContent accepts a disabled prop.
sed -n 1,20p frontend/web/components/tags/TagContent.tsx
rg -n 'TagContent[^a-zA-Z]' frontend/web --type=tsx -g '!**/TagContent.tsx' | rg 'disabled'

Repository: Flagsmith/flagsmith

Length of output: 934


🏁 Script executed:

git diff --unified=8 76c480252978b3a90b90fd18c513bcfa10093589 062e0860251d6cdb3df5c900767a282cf796b8a5 -- frontend/web/components/tables/TableTagFilter.tsx frontend/web/components/tags/TagContent.tsx
printf '\n--- TagContent at reviewed head ---\n'
git show 062e0860251d6cdb3df5c900767a282cf796b8a5:frontend/web/components/tags/TagContent.tsx | nl -ba | sed -n '1,22p;96,140p'
printf '\n--- TableTagFilter call sites at reviewed head ---\n'
git show 062e0860251d6cdb3df5c900767a282cf796b8a5:frontend/web/components/tables/TableTagFilter.tsx | nl -ba | sed -n '160,200p'

Repository: Flagsmith/flagsmith

Length of output: 10839


Remove the unsupported disabled prop from TagContent.

The call passes disabled, but TagContent declares only tag in its props type. The component derives disabled from tag itself, so the extra prop is redundant and causes an excess-property type error.

Suggested fix
-<TagContent disabled={Utils.tagDisabled(tag)} tag={tag} />
+<TagContent tag={tag} />

@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Visual Regression

20 screenshots compared. See report for details.
View full report

The table filter lowercased each tag's label but not what was typed, so
searching for a tag by the capitalised name it displays under found
nothing. The term is lowercased and trimmed once instead.

The archived and untagged rows are not tags and were rendered whatever
was typed, so a search that matched neither still showed them above an
empty list, or beside a "No tags" message. They match the search now.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

This branch was successfully deployed

2 active deployments
Preview – flagsmith-frontend-preview — 20e5a68b Deployed Oct 7, 2026 by vercel[bot]
Preview – flagsmith-frontend-staging — 20e5a68b Deployed Oct 7, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix front-end Issue related to the React Front End Dashboard

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tag filter search is case-sensitive

1 participant