Skip to content

feat(reports): add report comparison view (closes #36)#486

Merged
utksh1 merged 3 commits into
utksh1:mainfrom
Pragati5-DEBUG:feat/36-report-comparison-view
Jun 4, 2026
Merged

feat(reports): add report comparison view (closes #36)#486
utksh1 merged 3 commits into
utksh1:mainfrom
Pragati5-DEBUG:feat/36-report-comparison-view

Conversation

@Pragati5-DEBUG
Copy link
Copy Markdown
Contributor

Adds a frontend-only report comparison view at /reports/compare so you can diff findings between two scans without exporting PDFs.

  • Baseline vs comparison dropdowns load from GET /reports and GET /findings
  • Diff sections: new findings, fixed findings, unchanged, severity changed (matched by title + target + category)
  • Failed scans with findings appear in the dropdowns (labeled (scan failed)), not only status: ready
  • Reports page: “Compare Reports” link; normalizeReport() avoids blank list when API omits assets
  • Tests: compareFindings.test.ts (6), ReportCompare.test.tsx (2)

Closes #36.

Scope

Area | Change -- | -- frontend/src/utils/compareFindings.ts | Diff logic frontend/src/pages/ReportCompare.tsx | Compare UI frontend/src/pages/Reports.tsx | Link + report normalization frontend/src/routes.ts, App.tsx | Route /reports/compare

No backend API changes.

How to test

  1. Start backend + frontend; set API key in Settings.
  2. Run at least two scans that produce findings (ready or failed).
  3. Open Reports → Compare Reports (or /reports/compare).
  4. Confirm both dropdowns list scans; failed ones show (scan failed).
  5. Pick baseline (older) and comparison (newer); verify four diff sections update.
  6. Pick the same report in both dropdowns → “Select two different reports”.
  7. cd frontend  npm test -- --run testing/unit/utils/compareFindings.test.ts testing/unit/pages/ReportCompare.test.tsx

Notes

  • Comparison uses stored findings per task_id, not report PDF export.
  • If dropdowns are empty, you need two reports that each have findings (or API/auth failure).

@utksh1 utksh1 added level:intermediate 35 pts difficulty label for moderate contributor PRs type:feature Feature work category bonus label type:testing Testing work category bonus label area:frontend Frontend React/UI work labels Jun 4, 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.

Reviewed the report comparison route, finding diff utility, failed-report inclusion, and frontend tests. The feature is self-contained and acceptable for merge after updating against current main.

@utksh1 utksh1 added the gssoc:approved Admin validation: approved for GSSoC scoring label Jun 4, 2026
@utksh1 utksh1 merged commit 25c47cd into utksh1:main Jun 4, 2026
7 checks passed
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 gssoc:approved Admin validation: approved for GSSoC scoring level:intermediate 35 pts difficulty label for moderate 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.

[REPORTS] Add comparison view between two scan reports

2 participants