# NAN-453 — Balance Sheet 3 Expandable Sections

## Status: DONE — PR #390 (DRAFT)

## Commits
- `275f31d0` test(financials): add mapBalanceSheetDtoToDomain coverage for new bucket shape
- `d5f704d8` feat(balance-sheet): replace 2-tab switcher with 3 independent expandable sections (NAN-453)
- `701811c2` fix(balance-sheet-breakdown): render bucket headers + per-bucket grouping (NAN-453)

## What changed

### BalanceSheetSection.tsx
- Removed `SUB_TABS`, `activeTab` state, `FinancialSubTabs` component
- Added `BucketChartSection` sub-component to keep main function under 40 lines
- 3 independent `ExpandableSection` instances (each owns its own boolean state via `defaultExpanded` prop):
  - **Assets** — `defaultExpanded={true}`, stacked short-term + long-term bar chart
  - **Liabilities** — collapsed by default, stacked bar chart
  - **Equity** — collapsed by default, simple total bar chart; hidden if `equityValues` all null
- `getEquityValues()` helper searches common label variants for total equity
- "Balance sheet snapshot" ExpandableSection retained as-is

### BalanceSheetBreakdownScreen.tsx
- Replaced flat `[...assets, ...liabilities, ...equity]` single-table rendering
- Now wraps content in `ScrollView` with 3 `BucketSection` components
- Each `BucketSection` shows a styled heading + `FinancialBreakdownTable` at computed height
- Height computed as `HEADER_HEIGHT + (rows + immediate children) * ROW_HEIGHT`
- Empty buckets (`rows.length === 0`) are skipped

### financialsMapper.test.ts
- Added `BALANCE_SHEET_DTO` fixture constant
- Added `mapBalanceSheetDtoToDomain` describe block with 2 cases:
  - Happy path: all 3 buckets with children → correct domain shape
  - Empty equity: `equity: []` → maps to empty array, no crash

## Deviations from audit recommendation
None — implementation follows the audit gaps exactly.
