Skip to content

Conversation

@speaker-ender
Copy link
Contributor

@speaker-ender speaker-ender commented Nov 4, 2025

Ticket ENG-1820

Description Of Changes

Fixes an issue where the onCheck callback would only include checked values for items that were not filtered by the search value.

Code Changes

  • Added a handler to the onChange function to included previously selected items when returning filter values

Steps to Confirm

  1. Visit a datastore monitor screen
  2. Open the search filters
  3. Search for a specific filter name
  4. Select or deselect that filter
  5. Click apply
  6. Confirm that only the value you selected/deselected was changed

Pre-Merge Checklist

  • Issue requirements met
  • All CI pipelines succeeded
  • CHANGELOG.md updated
    • Add a db-migration This indicates that a change includes a database migration label to the entry if your change includes a DB migration
    • Add a high-risk This issue suggests changes that have a high-probability of breaking existing code label to the entry if your change includes a high-risk change (i.e. potential for performance impact or unexpected regression) that should be flagged
    • Updates unreleased work already in Changelog, no new entry necessary
  • UX feedback:
    • All UX related changes have been reviewed by a designer
    • No UX review needed
  • Followup issues:
    • Followup issues created
    • No followup issues
  • Database migrations:
    • Ensure that your downrev is up to date with the latest revision on main
    • Ensure that your downgrade() migration is correct and works
      • If a downgrade migration is not possible for this change, please call this out in the PR description!
    • No migrations
  • Documentation:
    • Documentation complete, PR opened in fidesdocs
    • Documentation issue created in fidesdocs
    • If there are any new client scopes created as part of the pull request, remember to update public-facing documentation that references our scope registry
    • No documentation updates required

@vercel
Copy link

vercel bot commented Nov 4, 2025

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

2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
fides-plus-nightly Ignored Ignored Preview Nov 4, 2025 11:03pm
fides-privacy-center Ignored Ignored Nov 4, 2025 11:03pm

@speaker-ender speaker-ender changed the title fix: monitor field filter logic [ENG_1820] fix: monitor field filter logic [ENG-1820] Nov 4, 2025
@speaker-ender speaker-ender marked this pull request as ready for review November 4, 2025 20:47
@speaker-ender speaker-ender requested a review from a team as a code owner November 4, 2025 20:47
@speaker-ender speaker-ender force-pushed the fix/monitor-field-filter branch from 28625a7 to 6a07c20 Compare November 4, 2025 20:49
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Overview

Greptile Summary

Fixed a filter state management bug where checked items would be lost when they were hidden by the search filter. The fix introduces internal state tracking in the Filter component to preserve checked items that are filtered out from view.

Key changes:

  • Added internalChecked state and synchronization logic in Filter.tsx to track all checked items independently of search filtering
  • Modified onCheck handler to preserve previously checked items that are currently hidden by search
  • Removed unused availableResourceFilters memoization in MonitorFieldFilters.tsx
  • Simplified filter key processing logic using direct constant references

The implementation correctly handles edge cases like unchecking visible items while others are hidden, and checking new items while searching.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The fix addresses a clear bug with a well-designed solution. The logic correctly preserves checked state for hidden filter items, handles edge cases properly, and includes appropriate state synchronization. The refactoring in MonitorFieldFilters removes unused code without changing behavior. No security issues, type errors, or logical flaws detected
  • No files require special attention

Important Files Changed

File Analysis

Filename Score Overview
clients/fidesui/src/components/data-display/Filter.tsx 5/5 Fixed filter state preservation bug when search filters items. Added internal state tracking to preserve checked items hidden by search
clients/admin-ui/src/features/data-discovery-and-detection/action-center/fields/MonitorFieldFilters.tsx 5/5 Removed unused memoized variable and simplified filter logic. Replaced dynamic filtering with constant references

2 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

Copy link
Contributor

@gilluminate gilluminate left a comment

Choose a reason for hiding this comment

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

Lots of awesome improvements in addition to the bug fix. Tested locally and working as expected. Nice work!

const statusTreeData: DataNode[] = useMemo(
() =>
availableResourceFilters.map((label) => ({
RESOURCE_STATUS.map((label) => ({
Copy link
Contributor

Choose a reason for hiding this comment

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

oof. good catch

@speaker-ender speaker-ender force-pushed the fix/monitor-field-filter branch from 9ad2200 to 5f6e96f Compare November 4, 2025 23:03
@speaker-ender speaker-ender added this pull request to the merge queue Nov 4, 2025
Merged via the queue into main with commit b1c3b9d Nov 4, 2025
47 checks passed
@speaker-ender speaker-ender deleted the fix/monitor-field-filter branch November 4, 2025 23:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants