Skip to content

fix(budget): categories filter only applies to Budget Health, not Cost Breakdown#578

Merged
steilerDev merged 2 commits intobetafrom
fix/577-categories-filter-scope
Mar 8, 2026
Merged

fix(budget): categories filter only applies to Budget Health, not Cost Breakdown#578
steilerDev merged 2 commits intobetafrom
fix/577-categories-filter-scope

Conversation

@steilerDev
Copy link
Owner

Summary

  • Categories filter on the budget page now only filters the Budget Health section
  • Cost Breakdown table always shows all categories regardless of filter selection
  • Added stable emptyCategories constant to avoid re-renders

Fixes #577

Test plan

  • 2 new tests verifying filter scope (Budget Health filtered, Cost Breakdown unfiltered)
  • All 61 existing tests pass

Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com

…t Breakdown

The categories filter on the budget page was filtering both the Budget Health
section and the Cost Breakdown table. Now the Cost Breakdown always receives
an empty category set, showing all categories regardless of filter selection.

Fixes #577

Co-Authored-By: Claude frontend-developer (Haiku) <noreply@anthropic.com>
Co-Authored-By: Claude qa-integration-tester (Haiku) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Owner Author

@steilerDev steilerDev left a comment

Choose a reason for hiding this comment

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

[security-engineer]

PR #578 reviewed. Frontend-only bug fix — 2 lines of production code changed:

  1. Module-level const emptyCategories = new Set<string | null>() added (stable reference, no user input).
  2. selectedCategories={emptyCategories} replaces selectedCategories={selectedCategories} at the CostBreakdownTable call site.

Security checklist:

  • No injection surface — no user input, no API calls, no DOM manipulation
  • No new dependencies
  • No sensitive data exposure
  • No auth/authz changes
  • No XSS vectors — the emptyCategories constant is a typed Set literal; CostBreakdownTable was already audited (PR #157)
  • Test additions correctly assert the intentional decoupling of the cost breakdown from the category filter state

No security findings.

Copy link
Owner Author

@steilerDev steilerDev left a comment

Choose a reason for hiding this comment

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

[product-architect]

Reviewed the 2-file diff. Clean, minimal fix with correct approach.

Architecture compliance: Pass. No structural changes -- just a prop value swap at the page level.

Technical correctness:

  • The module-level emptyCategories constant is the right pattern: stable reference avoids unnecessary re-renders of CostBreakdownTable, and size === 0 is already the "show all" semantic in that component (line 606).
  • No risk of mutation since the Set is never exposed to modifying code.

Test coverage: Two new tests adequately cover the fix -- partial category selection and full clear -- verifying that Budget Health filters while Cost Breakdown remains unaffected.

No wiki updates needed (no API, schema, or architecture changes).

LGTM.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@steilerDev steilerDev merged commit 68f1baa into beta Mar 8, 2026
13 checks passed
@github-actions
Copy link
Contributor

github-actions bot commented Mar 8, 2026

🎉 This PR is included in version 1.13.0-beta.26 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@github-actions
Copy link
Contributor

github-actions bot commented Mar 8, 2026

🎉 This PR is included in version 1.13.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants