## 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). |
||
|---|---|---|
| .. | ||
| .pest | ||
| Browser | ||
| Feature | ||
| Performance | ||
| Unit | ||
| Pest.php | ||
| TestCase.php | ||
| bootstrap.php | ||