Skip to content

feat(bet-form): add error-boundary fallback UI with retry action (Closes #773) - #869

Open
waterWang wants to merge 1 commit into
Predictify-org:mainfrom
waterWang:feat/betform-error-boundary-773
Open

feat(bet-form): add error-boundary fallback UI with retry action (Closes #773)#869
waterWang wants to merge 1 commit into
Predictify-org:mainfrom
waterWang:feat/betform-error-boundary-773

Conversation

@waterWang

Copy link
Copy Markdown

Description

Adds an attractive error-boundary fallback for BetForm with a retry action, as requested in issue #773.

Changes

  • components/error-boundary.tsx: Updated fallback prop to support both ReactNode and render-function signatures. When passed a function, it receives { error, incidentId, resetErrorBoundary } for custom fallback rendering.
  • src/components/BetFormErrorFallback.tsx: New BetForm-specific error fallback component with:
    • Alert icon and "couldn't load" message
    • Incident ID display for debugging
    • Retry button that resets the error boundary
    • Error message (visually hidden, available for testing)
    • Responsive layout with dark-mode support
  • src/pages/BetForm.tsx: Wrapped the form content in ErrorBoundary with BetFormErrorFallback as the render-prop fallback
  • src/pages/BetForm.error-boundary.test.tsx: 3 tests covering:
    • Fallback rendering with error details and incident ID
    • Retry button invocation
    • Rendering without incident ID

Testing

  • npx jest src/pages/BetForm.error-boundary — 3/3 passing
  • ✅ TypeScript compilation — no errors
  • ✅ Existing BetForm tests unaffected (pre-existing failures unrelated to this change)

Closes #773

@vercel

vercel Bot commented Aug 8, 2026

Copy link
Copy Markdown

@waterWang is attempting to deploy a commit to the Jagadeesh B's projects Team on Vercel.

A member of the Team first needs to authorize it.

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.

Polish BetForm error-boundary fallback UI [b#039]

1 participant