Skip to content

feat(stats): add loading, error, and empty states for stats page - #464

Merged
mikewheeleer merged 2 commits into
Agentpay-Org:mainfrom
mysterio123865:feature/stats-01-states
Jul 29, 2026
Merged

feat(stats): add loading, error, and empty states for stats page #464
mikewheeleer merged 2 commits into
Agentpay-Org:mainfrom
mysterio123865:feature/stats-01-states

Conversation

@mysterio123865

Copy link
Copy Markdown
Contributor

Summary

Implements Issue by adding comprehensive loading, error, and empty states to the Stats page, improving user feedback, accessibility, and retry behavior.

Changes

  • Added Loading state:

    • Displays a spinner while the initial stats request is in progress
  • Added Error state:

    • Shows an EmptyState with a keyboard-accessible Retry action when the initial load fails
    • Preserves existing stats during polling failures and displays an ErrorMessage with a Try again action
  • Added Empty state:

    • Displays an EmptyState with a Refresh action when the response contains no usable stats fields
  • Improved accessibility:

    • Made loading, error, and empty states mutually exclusive
    • Added aria-live="polite" announcements following the existing admin page pattern

Validation

✅ Stats tests passed (25/25)
✅ 100% coverage for page.tsx
npm run build completed successfully

Note: Repository-wide lint and the full test suite still contain pre-existing failures (api-keys tests and unrelated lint issues in other files). These are unrelated to this change.

Tracking

Closes #385

mysterio123865 and others added 2 commits July 28, 2026 18:52
Co-authored-by: Cursor <cursoragent@cursor.com>
@mikewheeleer
mikewheeleer merged commit e849345 into Agentpay-Org:main Jul 29, 2026
1 check failed
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.

Add explicit empty and error states to the stats view

2 participants