Skip to content

fix: wrap dashboard routed content in an error boundary to contain per-page crashes - #959

Open
waterWang wants to merge 1 commit into
Grainlify:mainfrom
waterWang:fix/ecosystemspage-i18n-interpolation
Open

fix: wrap dashboard routed content in an error boundary to contain per-page crashes#959
waterWang wants to merge 1 commit into
Grainlify:mainfrom
waterWang:fix/ecosystemspage-i18n-interpolation

Conversation

@waterWang

Copy link
Copy Markdown
Contributor

Summary

Adds a route-level error boundary to the dashboard layout so that an uncaught error in any single dashboard sub-page doesn't blank the entire app.

Changes

  • DashboardLayout.tsx: Wrapped <Outlet /> with <ErrorBoundary> using location.pathname as a key so navigating to a different route recovers cleanly from the error state.
  • DashboardLayout.test.tsx: Added test verifying that errors in child routes show the ErrorBoundary fallback UI while the sidebar/header/navigation remain intact.

Acceptance criteria

  • An error in one dashboard sub-page shows the boundary fallback while sidebar/header/navigation remain usable.
  • Navigating to a different route after a crash recovers cleanly (via key={location.pathname}).
  • Non-erroring sub-pages are entirely unaffected.

Closes #503

…r-page crashes

Closes Grainlify#503

- Wraps <Outlet /> in DashboardLayout.tsx with <ErrorBoundary>
- Uses location.pathname as ErrorBoundary key so navigating to a
different route recovers cleanly from the error state
- Adds test verifying that errors in child routes show the fallback
UI while the sidebar/header/navigation remain intact
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 a route-level error boundary to src/features/dashboard/Dashboard.tsx

1 participant