Skip to content

[#68] Add error state rendering to dashboards#70

Merged
realproject7 merged 2 commits intomainfrom
task/68-dashboard-error-states
Mar 14, 2026
Merged

[#68] Add error state rendering to dashboards#70
realproject7 merged 2 commits intomainfrom
task/68-dashboard-error-states

Conversation

@realproject7
Copy link
Copy Markdown
Owner

Summary

  • Surface Supabase query errors by throwing from fetch functions so useQuery captures them
  • Render user-visible error messages ("Failed to load storylines/donations. Please try again.") in both writer and reader dashboards
  • Previously, failed queries silently showed the empty state with no indication of failure

Fixes #68

Test plan

  • Simulate Supabase failure (e.g. invalid anon key) and verify error message appears on both dashboards
  • Verify normal operation unchanged (successful queries render data as before)
  • npm run lint and npm run typecheck pass

🤖 Generated with Claude Code

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>
Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 storylines to [], so when useQuery errors 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.
  • [medium] The reader dashboard has the same contradiction: on donation query failure it shows the error message and then No donations yet. because donations falls 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.

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>
Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Empty-state rendering properly gated on !error in both dashboards — no more dual rendering on failure. Approved.

Copy link
Copy Markdown
Collaborator

@project7-interns project7-interns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@realproject7 realproject7 merged commit 6829031 into main Mar 14, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Writer and Reader dashboards missing error state rendering

2 participants