-
Notifications
You must be signed in to change notification settings - Fork 84
fix: monitor field filter logic [ENG-1820] #6914
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
28625a7 to
6a07c20
Compare
There was a problem hiding this 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
internalCheckedstate and synchronization logic inFilter.tsxto track all checked items independently of search filtering - Modified
onCheckhandler to preserve previously checked items that are currently hidden by search - Removed unused
availableResourceFiltersmemoization inMonitorFieldFilters.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
gilluminate
left a comment
There was a problem hiding this 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) => ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oof. good catch
9ad2200 to
5f6e96f
Compare
Ticket ENG-1820
Description Of Changes
Fixes an issue where the
onCheckcallback would only include checked values for items that were not filtered by the search value.Code Changes
Steps to Confirm
Pre-Merge Checklist
CHANGELOG.mdupdatedmaindowngrade()migration is correct and works