feat(app): show a compact top-categories summary after scans (#158) - #178
Conversation
|
@LouisDeconinck Can you review it please. |
LouisDeconinck
left a comment
There was a problem hiding this comment.
Verified against App.jsx — the ranking is correct: byCategory() already sorts groups by total reclaimable bytes descending, so .filter(c => c.total > 0).slice(0, cap) does yield the top categories. f.reclaimable is the right field (same as the existing total at L164), and visibleFindings is memoized and filters quarantined paths, so the summary updates correctly after quarantine and during preview.
One non-blocking nit: aria-label on a plain <div> isn't announced by screen readers without a role — a role="region" or <section> element would make the label effective. Fine to land as-is.
Approved.
Muawiya-contact
left a comment
There was a problem hiding this comment.
Thanks for this additional improvement, @littfed! I checked the category ranking, zero-total handling, and filtering after quarantine; the compact summary meets #158, all 12 app test files passed locally, and CI is green. Approved, and thank you @LouisDeconinck for independently checking the aggregation and preview behavior.
…Moves#158) - Add TopCategoriesSummary component ranking categories by reclaimable bytes - Render summary above detailed results for both live preview and final reports - Compact UI displaying category label and formatted reclaimable bytes - Add styling for summary card, list, and monospace size values - Add unit and styling tests in App.test.mjs and styles.test.mjs - Add changelog fragment in changelog.d/158-top-categories-summary.added.md
77c7ac2 to
352e31a
Compare
Resolves #158
Summary
Adds a compact top-categories summary card rendered above the detailed expandable result sections. Users immediately see where disk space is consumed without needing to manually expand every section.
Changes
app/src/App.jsx:TopCategoriesSummary({ items, cap = 5 }): groups findings by category usingbyCategory(), aggregates total reclaimable bytes per category, and displays the top categories ranked by size.<TopCategoriesSummary items={visibleFindings} />right above the detailed sections (<DuplicatesSection>and<CategorySection>).visibleFindings, and automatically updates if items are quarantined.app/src/styles.css:.top-categories-summary, list formatting, and monospace values for reclaimable sizes.app/src/App.test.mjs&app/src/styles.test.mjs:TopCategoriesSummaryrenders top categories and is placed above detailed sections.changelog.d/158-top-categories-summary.added.md:Verification
npm testinapp/passes 100% (74/74 tests).npm run buildinapp/builds cleanly.python3 scripts/changelog.py checkpasses cleanly (validated 2 fragments).