Skip to content

fix(web): show distinct error states with retry across Topics loaders - #618

Merged
gkhngyk merged 1 commit into
ansvisor:mainfrom
d180:fix/topics-load-error-state
Aug 3, 2026
Merged

gkhngyk merged 1 commit into
ansvisor:mainfrom
d180:fix/topics-load-error-state

Conversation

@d180

@d180 d180 commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • All three Topics data loaders swallowed failures into console.error, so a failed request rendered as a normal empty state — "No topics defined yet" or "Topic not found" — with no way to tell an outage from a genuinely empty account, and no retry.
  • Adds an error state to each loader and a distinct error UI with a retry action:
    • topics/page.tsx — leaderboard card now shows a "Failed to load topics" error with retry instead of the empty state (uses the page's existing i18n).
    • topics/[id]/page.tsx — a failed load now shows a "Couldn't load this topic" card with retry; "Topic not found" is now reserved for a successful fetch that genuinely returns nothing.
    • topics/_suggestions-card.tsx — mirrors the pattern already shipped for the Prompts suggestions card (#previous fix), same error state + retry button.

Related issue

Closes #595

Type of change

  • fix — Bug fix

Checklist

  • Branch follows the naming convention (fix/)
  • Commits follow Conventional Commits
  • yarn lint passes (run from web/)
  • yarn typecheck passes (run from web/)
  • yarn format:check passes (run from web/)
  • Changes are focused — one concern per PR

@gkhngyk gkhngyk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All three loaders covered, and reserving "Topic not found" for a successful-but-empty fetch is exactly right. Thanks!

@gkhngyk
gkhngyk merged commit 98787ea into ansvisor:main Aug 3, 2026
4 checks passed
@gkhngyk gkhngyk mentioned this pull request Aug 3, 2026
7 of 12 tasks
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.

Topics: load failures render as "No topics defined yet" / "Topic not found" with no error state

2 participants