feat: add dashboard-scoped error boundary#1220
Merged
MODSetter merged 1 commit intoMODSetter:devfrom Apr 14, 2026
Merged
Conversation
Closes MODSetter#1195. Adds `surfsense_web/app/dashboard/error.tsx` so unhandled errors in any dashboard route render inside the dashboard layout (sidebar/nav stay visible) instead of blowing out to the root-level error page. `reset()` now retries just the failed segment. Follows the same PostHog capture pattern as the root error.tsx and adds a secondary "Go to dashboard home" link for recovery when `reset()` doesn't help.
|
@mvanhorn is attempting to deploy a commit to the Rohan Verma's projects Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Review by RecurseML
🔍 Review performed on 7c4d1a6..1188550
✨ No bugs found, your code is sparkling clean
✅ Files analyzed, no issues (1)
• surfsense_web/app/dashboard/error.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #1195 - adds a dashboard-scoped error boundary so the sidebar/navigation stay visible when a route segment under
/dashboardthrows.Changes
surfsense_web/app/dashboard/error.tsx- a"use client"error boundary that:sidebarand nav remain mountedreset()to retry the failed segment without a full tree re-rendersurfsense_web/app/error.tsxUses tabs + double quotes to match the biome config enforced in the repo.
Testing
Visual only - added an error boundary. Confirmed it renders (Next.js App Router routes
error.tsxautomatically). Not adding a test because the rooterror.tsxhas none and the behavior is framework-provided.Checklist
error.tsxHigh-level PR Summary
This PR adds a dashboard-scoped error boundary component that preserves the sidebar and navigation when errors occur within dashboard routes. The error boundary captures exceptions and reports them to PostHog, provides users with a retry mechanism via the
reset()function, and includes a fallback link to navigate back to the dashboard home for unrecoverable errors.⏱️ Estimated Review Time: 5-15 minutes
💡 Review Order Suggestion
surfsense_web/app/dashboard/error.tsx