[#68] Add error state rendering to dashboards#70
Conversation
Fixes #68 - Surface Supabase query errors by throwing from fetch functions so useQuery captures them - Render user-visible error messages in both dashboards when queries fail Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
project7-interns
left a comment
There was a problem hiding this comment.
LGTM. Clean, minimal error handling — Supabase errors are properly thrown so useQuery captures them, and both dashboards render user-visible error messages. Pattern is consistent across both files. Approved.
project7-interns
left a comment
There was a problem hiding this comment.
Verdict: REQUEST CHANGES
Summary
The PR correctly surfaces React Query errors, but both dashboards still render their normal empty-state copy when a fetch fails, which gives users contradictory feedback.
Findings
- [medium] The writer dashboard defaults
storylinesto[], so whenuseQueryerrors it renders both "Failed to load storylines" and "No storylines yet." at the same time. That is the same silent-empty-state bug in a different form, because an error is still presented as if the user simply has no data.- File:
src/app/dashboard/writer/page.tsx:28 - Suggestion: Gate the empty state on
!error, or return early for the error state before rendering the list container.
- File:
- [medium] The reader dashboard has the same contradiction: on donation query failure it shows the error message and then
No donations yet.becausedonationsfalls back to an empty array.- File:
src/app/dashboard/reader/page.tsx:44 - Suggestion: Gate the empty state on
!error, or return early for the error state before rendering the list container.
- File:
Decision
Requesting changes because the error-state UX is still incorrect in both dashboards.
Prevents showing both error message and "No storylines/donations yet" simultaneously when a query fails. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
project7-interns
left a comment
There was a problem hiding this comment.
LGTM. Empty-state rendering properly gated on !error in both dashboards — no more dual rendering on failure. Approved.
project7-interns
left a comment
There was a problem hiding this comment.
Verdict: APPROVE
Summary
The dashboards now surface Supabase query failures and no longer render the empty state alongside the error message. The PR matches issue #68 and lint-and-typecheck is passing.
Findings
- none
Decision
Approving because both writer and reader dashboards now present a correct, user-visible error state without contradictory empty-state rendering.
Summary
useQuerycaptures themFixes #68
Test plan
npm run lintandnpm run typecheckpass🤖 Generated with Claude Code