Empty / loading / error state audit
One-line inventory of what each page renders in the three "no happy path"
states, and what changed during the public-launch trust-polish pass. Any
shared building blocks live in frontend/src/components/StateBlocks.tsx
(EmptyState, ErrorState, LoadingBlock) and reuse the existing
ink-* / sage-* / clay-* tokens.
Ordered by visibility.
Dashboard (pages/Dashboard/index.tsx)
- Empty — accounts query returns
[]→ onboarding block with a CTA to/accounts(was: blank Hero + "—"). - Loading — root queries pending → Hero renders "—" placeholder;
BalanceChart section shows
LoadingBlock(was: rawanimate-pulsediv). InsightsSection/SankeySection also swapped toLoadingBlock. - Error — accounts or balance query fails →
ErrorStateat the top with retry that refetches all root queries; downstream sections suppressed. InsightsSection and SankeySection also route their per-panel errors throughErrorState.
Transactions (pages/Transactions/index.tsx)
- Empty —
TransactionsTablealready renders "Aucune transaction." in its tbody. Preserved. - Loading — table already renders "Chargement…" in its tbody. Preserved.
- Error — was silent: table stayed empty after fetch failure. Now
wraps the table in
ErrorStatewith a retry whentxQ.isError. Mutation errors (delete/bulk delete/checkpoint/bulk-categorize) already had inline banners.
Accounts (pages/Accounts/index.tsx)
- Empty — "Aucun compte pour l'instant." block already existed. Preserved.
- Loading — was: implicit "empty state" while the query was pending.
Now:
LoadingBlock. - Error — was: same implicit empty. Now:
ErrorStatewith retry.
Budgets (pages/Budgets/Caps.tsx, pages/Budgets/Envelopes/Envelopes.tsx)
- Empty — both tabs already had an onboarding empty-state ("Aucun budget défini." / "Aucune enveloppe pour ce mois"). Preserved.
- Loading — both previously fell through to the empty state while
report/reportQwas pending. Now renderLoadingBlock. - Error — both previously stayed on the empty state on fetch failure.
Now route through
ErrorStatewith retry.
Rules (pages/Rules/index.tsx)
- Empty — the grouped view lists all categories with a "+ ajouter" affordance, so a fresh install already reads as a directory rather than a blank page. Preserved.
- Loading — was: implicit empty (
rules = []) while queries pending. Now:LoadingBlock. - Error — was: silent empty. Now:
ErrorStaterefetching bothrulesQandcatQ.
Data — Duplicates & PDF Templates (pages/Imports/DuplicatesPanel.tsx, pages/Imports/PdfTemplatesPanel.tsx)
- Empty — both panels already rendered a friendly empty message. Preserved.
- Loading — DuplicatesPanel had no loading branch (fell through to
empty); PdfTemplatesPanel had a raw
animate-pulseblock. Both now renderLoadingBlock. - Error — new
ErrorStatewith retry ondupsQ.isErrorandtemplatesQ.isError.BackupPanelis mutation-only and already surfacesApiError.messageinline viabackupError.
Imports (pages/Data/Imports.tsx)
- Empty —
FileImportsListalready renders "Aucun import pour l'instant." in its tbody. Preserved. - Loading — was: empty table while the query was pending. Now:
LoadingBlockabove the section. - Error — was: silent empty on failure. Now:
ErrorStatewith retry.UploadFormmutation errors are already surfaced inline.
Settings (pages/Settings.tsx)
- Empty — not applicable (settings always exist; fallback
DEFAULTSapplied byuseSettings). - Loading — was: raw
animate-pulseblock. Now:LoadingBlock.data-testid="settings-skeleton"preserved for existing tests. - Error — mutation errors already surfaced inline via
t('settings.errors.saveFailed'). The initial fetch falls back toDEFAULTS, so a background failure never blocks the page.
Profilee (pages/Profilee.tsx)
- Empty / Loading — not applicable: the page is a form seeded from
the
mecache (populated at app boot by the auth probe). - Error — mutation errors already surfaced inline via
ApiErrormessage in aclay-*block. Success banner insage-*.
Login (pages/Login.tsx)
- Empty — not applicable (blank form is the intended initial state).
- Loading — the
onboarding-statusquery falls back toneedsOnboarding = falsewhile pending, so the form is rendered immediately with the login-mode default. No skeleton needed. - Error — login/create mutations surface
ApiError.messageinline in aclay-*block; the onboarding-status probe silently falls back on failure (login mode is safe as a default).
Non-scope pages touched by shared plumbing
pages/Rules/Tri.tsx,pages/Rules/Categories.tsx,pages/Accounts/Patterns.tsx, and thePdfTemplateWizardwere not part of the scope for this pass; they remain unchanged and can be audited in a follow-up sweep if their fetch surface warrants it.