feat: saved views frontend hook, panel, and Findings integration (#235)#404
Open
khat190 wants to merge 2 commits into
Open
feat: saved views frontend hook, panel, and Findings integration (#235)#404khat190 wants to merge 2 commits into
khat190 wants to merge 2 commits into
Conversation
utksh1
requested changes
May 29, 2026
Owner
utksh1
left a comment
There was a problem hiding this comment.
Holding this frontend companion PR until the saved-views backend contract in #403 is fixed. The UI and hook work depends on /api/v1/saved-views, and merging the frontend first would leave the feature in localStorage fallback mode with the server path still unreliable. Please rebase once #403 is corrected and make sure the frontend tests still pass against the finalized response and error contract.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Changed
frontend/src/hooks/useSavedViews.ts— Custom hook managing full preset CRUD. Writes to localStorage immediately (offline-safe) and syncs to /api/v1/saved-views when the backend is reachable. Validates every preset on read so corrupt data is silently dropped. Includes doc comment explaining exact sync failure behaviour.frontend/src/components/SavedViewsPanel.tsx— Dropdown panel in the Findings filter row. Save current filters under a name, apply in one click, inline rename, two-click delete with confirm guard.frontend/src/pages/Findings.tsx— Minimal diff on the original. Added hook, currentPreset snapshot, applyPreset helper, and SavedViewsPanel next to Reset Filters. Everything else untouched.frontend/testing/unit/hooks/useSavedViews.test.ts— 28 tests covering all CRUD operations, localStorage persistence, corrupt data handling, and validation.-
frontend/testing/unit/pages/Findings.test.tsx— Updated tests matching the existing Findings UI.Depends on: feat/saved-views-backend (PR #403) for backend persistence. Works standalone via localStorage if backend is unavailable.
Refs #235
Screenshots:
