Skip to content

feat: saved views frontend hook, panel, and Findings integration (#235)#404

Open
khat190 wants to merge 2 commits into
utksh1:mainfrom
khat190:feat/saved-views-frontend
Open

feat: saved views frontend hook, panel, and Findings integration (#235)#404
khat190 wants to merge 2 commits into
utksh1:mainfrom
khat190:feat/saved-views-frontend

Conversation

@khat190
Copy link
Copy Markdown
Contributor

@khat190 khat190 commented May 28, 2026

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:
WhatsApp Image 2026-05-29 at 4 40 25 AM

@utksh1 utksh1 added level:advanced 55 pts difficulty label for advanced contributor PRs type:feature Feature work category bonus label type:testing Testing work category bonus label area:frontend Frontend React/UI work labels May 29, 2026
Copy link
Copy Markdown
Owner

@utksh1 utksh1 left a comment

Choose a reason for hiding this comment

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

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.

@khat190 khat190 requested a review from utksh1 May 29, 2026 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:frontend Frontend React/UI work level:advanced 55 pts difficulty label for advanced contributor PRs type:feature Feature work category bonus label type:testing Testing work category bonus label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants