Skip to content

feat(frontend): add report diff view utility and UI component #239#293

Open
YerraguntaAjayKumar wants to merge 3 commits into
utksh1:mainfrom
YerraguntaAjayKumar:feature/report-diff-view
Open

feat(frontend): add report diff view utility and UI component #239#293
YerraguntaAjayKumar wants to merge 3 commits into
utksh1:mainfrom
YerraguntaAjayKumar:feature/report-diff-view

Conversation

@YerraguntaAjayKumar
Copy link
Copy Markdown

Description

This PR implements an optimized, local-first Report Diff View Component that allows users to seamlessly compare scan findings across two historical scan iterations. The interface integrates natively into the existing scan management dashboard with zero external package overhead.

Key Technical Implementations:

  1. High-Performance Utility Engine (frontend/src/utils/reportDiff.ts): Implements an O(N + M) linear-time comparison utility mapping target hashes onto Map records. This tracks added, fixed, unchanged, and priority-drifted items efficiently without clogging the main JavaScript runtime thread.
  2. Semantic Neobrutalist UI (frontend/src/components/ReportDiffView.tsx): Renders a dedicated tabbed interface styled explicitly with the repository's theme parameters (bg-charcoal, text-silver-bright, custom status badges). Shows dedicated lists for:
    • New Findings (Red badge mappings)
    • Fixed/Remediated Elements (Green strikethrough lines)
    • Severity Shifts (Amber transition mappings detailing old → new states)
  3. Dashboard Integration (frontend/src/pages/Scans.tsx): Binds an iterative Compare_Scans action into the multi-select bulk controller. Restricts evaluation to completed records and displays a clean, animated full-screen comparison view.

Related Issues

Closes #239

Type of Change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

  • Unit Test Arrays: Created comprehensive test sweeps under frontend/testing/unit/utils/reportDiff.test.ts exploring empty matrices, identical iterations, and multi-layered severity transitions.
  • Local Dev Server Execution: Validated component rendering using ./start.sh across multi-finding payloads to rule out UI layout shifting.

Checklist

  • My code follows the code style of this project.
  • I have performed a self-review of my own code.
  • My changes generate no new warnings.

@YerraguntaAjayKumar
Copy link
Copy Markdown
Author

Hi @utksh1! Just wanted to update that the implementation for the Report Diff View is fully complete.

All automated CI checks have passed successfully. I've ensured that the $O(N + M)$ utility handles large payloads smoothly and that the Neobrutalist UI integrates cleanly with the existing dashboard theme.

Ready for your review whenever you have some time! Thanks!

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.

[FRONTEND] Add report diff view with finding-level changes

1 participant