-
Notifications
You must be signed in to change notification settings - Fork 84
refactor: persist monitor field filters [ENG-1927] #6935
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
refactor: persist monitor field filters [ENG-1927] #6935
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
83ee694 to
0a5aa82
Compare
chore: updating changelog
0a5aa82 to
ed6f8ca
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
This PR removes an 8-line useEffect hook that automatically reset filter state whenever the stagedResourceUrn changed in the action center monitor field filters. Previously, selecting different resources from the tree would reset filters to their default values, creating a poor user experience. The change enables filters to persist across tree selections, allowing users to maintain their filter preferences while exploring different resources.
The implementation is clean and straightforward:
- Removed lines 175-183 which contained the
useEffectthat calledresetToInitialState()onstagedResourceUrnchanges - Filter state is managed via URL query params using the
useMonitorFieldsFiltershook - The
stagedResourceUrnis still passed to the API query to fetch filtered data for the selected resource - All other filter functionality (apply, reset, clear) remains intact
Confidence Score: 5/5
- This PR is safe to merge with minimal risk
- The change is extremely simple and low-risk: it removes 8 lines of code that were causing undesired behavior. The filter state management continues to work through URL query params, and the stagedResourceUrn is still properly passed to API calls to fetch the correct data. No new logic is introduced, only the auto-reset behavior is removed.
- No files require special attention
Important Files Changed
File Analysis
| Filename | Score | Overview |
|---|---|---|
| CHANGELOG.md | 5/5 | Added changelog entry documenting the filter persistence behavior change |
| clients/admin-ui/src/features/data-discovery-and-detection/action-center/fields/MonitorFieldFilters.tsx | 5/5 | Removed useEffect hook that reset filters when stagedResourceUrn changed, enabling filter persistence across tree selections |
2 files reviewed, no comments
jpople
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.
Tested locally, confirmed working.
Ticket ENG-1927
Description Of Changes
Persisting monitor field filters while filtering by a staged resource in the resource tree.
Code Changes
useEffecthook used to reset the filters when the resource urn changedSteps to Confirm
Helios V2beta flag is set and there is an available resource monitorFilterbutton and change the default filtersPre-Merge Checklist
CHANGELOG.mdupdatedmaindowngrade()migration is correct and works