- {(() => {
- // Issue #178 — show a 2-step onboarding card while the user has no
- // accounts or no snapshots yet. We probe accountsLatest for ANY
- // snapshot date so the empty-state guard is independent of the
- // active period filter (state.period).
- const accountsCount = state.accountsLatest.length;
- const hasAnySnapshot = state.accountsLatest.some(
- (a) => a.latest_snapshot_date != null
- );
- if (accountsCount === 0 || !hasAnySnapshot) {
- return (
+ {/* Issue #178 — empty-state guard. We probe accountsLatest for ANY
+ snapshot date so the guard is independent of the active period
+ filter (state.period). When empty, we render only the onboarding
+ card — period selector, chart and accounts table would all show
+ empty states stacked under it (S2 from #187). */}
+ {(() => {
+ const accountsCount = state.accountsLatest.length;
+ const hasAnySnapshot = state.accountsLatest.some(
+ (a) => a.latest_snapshot_date != null
+ );
+ const isEmpty = accountsCount === 0 || !hasAnySnapshot;
+
+ if (isEmpty) {
+ return (
+