Skip to content

feat(app): show a compact top-categories summary after scans (#158) - #178

Merged
Muawiya-contact merged 1 commit into
Coding-Moves:mainfrom
littfed:feat/top-categories-summary
Sep 15, 2026
Merged

Muawiya-contact merged 1 commit into
Coding-Moves:mainfrom
littfed:feat/top-categories-summary

Conversation

@littfed

@littfed littfed commented Sep 13, 2026

Copy link
Copy Markdown

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:
    • Added TopCategoriesSummary({ items, cap = 5 }): groups findings by category using byCategory(), aggregates total reclaimable bytes per category, and displays the top categories ranked by size.
    • Mounted <TopCategoriesSummary items={visibleFindings} /> right above the detailed sections (<DuplicatesSection> and <CategorySection>).
    • Works dynamically for both live preview results and final reports via visibleFindings, and automatically updates if items are quarantined.
  • app/src/styles.css:
    • Added compact card styling for .top-categories-summary, list formatting, and monospace values for reclaimable sizes.
  • app/src/App.test.mjs & app/src/styles.test.mjs:
    • Added unit test asserting TopCategoriesSummary renders top categories and is placed above detailed sections.
    • Added test validating compact card CSS rules.
  • changelog.d/158-top-categories-summary.added.md:
    • Added change fragment describing the feature.

Verification

  • npm test in app/ passes 100% (74/74 tests).
  • npm run build in app/ builds cleanly.
  • python3 scripts/changelog.py check passes cleanly (validated 2 fragments).

@Muawiya-contact

Copy link
Copy Markdown
Member

@LouisDeconinck Can you review it please.

@LouisDeconinck LouisDeconinck left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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 Muawiya-contact left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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
@littfed
littfed force-pushed the feat/top-categories-summary branch from 77c7ac2 to 352e31a Compare September 15, 2026 17:05
@Muawiya-contact
Muawiya-contact merged commit 9eea0a5 into Coding-Moves:main Sep 15, 2026
14 checks passed
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.

Show a compact top-categories summary after scans

4 participants