whisper-money/resources/js/components/dashboard
Víctor Falcón 53d051800b
feat: expand parent categories inline in breakdowns (#486)
## What

Expand/collapse child categories inline in three places:
- Dashboard → **Top spending categories**
- Cashflow → **Income sources**
- Cashflow → **Expense categories**

## How it looks

<img width="1225" height="928" alt="image"
src="https://github.com/user-attachments/assets/aadce904-bfdd-46eb-b919-8695577845d7"
/>

## Implementation

**Frontend**
- `useExpandableCategories` hook: tracks expanded set, lazy-fetches
children once, caches, resets on period change.
- `AnimatedCollapse` component for the height animation.
- Recursive rows in `BreakdownCard` and `TopCategoriesCard`.

**Backend**
- Extracted `rollUpByTree`/`displayNodeFor` out of
`CashflowAnalyticsController` into `CategoryTree::rollUp` (now shared by
cashflow + dashboard).
- Dashboard `top-categories` emits `has_children`/`is_direct` and
accepts `?parent` to drill into a category's children (children + a
direct "Parent" node), mirroring the existing cashflow breakdown drill.
- Added Spanish translations for the new toggle labels.

## Tests
- Backend: `has_children` true/false + parent-drill split (children +
direct node) for dashboard top categories.
- Component: chevron expands, lazily fetches `parent=…`, renders the
child, flips to "Hide subcategories".
- Full suite green; pint / eslint / prettier clean.

> Note: children fetch lazily on first expand (same pattern as the
Sankey inline expand).
2026-06-04 11:19:21 +02:00
..
account-balance-card.tsx fix(dashboard): dismiss account card tooltip when tapping outside (#318) 2026-04-23 08:35:21 +01:00
account-type-icon.tsx refactor(accounts): unify account type icons via accountIconByType helper (#180) 2026-03-02 08:47:44 +00:00
amount-trend-indicator.tsx fix: Prevent account card content overflow on long names (#133) 2026-02-19 10:22:51 +01:00
cashflow-summary-card.tsx perf(dashboard): optimize query performance and eliminate redundant requests (#146) 2026-02-24 08:43:48 +01:00
net-worth-chart.tsx fix: preserve cents in chart amounts (#270) 2026-04-10 15:41:24 +02:00
percentage-trend-indicator.tsx fix: preserve cents in chart amounts (#270) 2026-04-10 15:41:24 +02:00
top-categories-card.tsx feat: expand parent categories inline in breakdowns (#486) 2026-06-04 11:19:21 +02:00