From f842f064669fefe3df5f94f3d0945140e76e5946 Mon Sep 17 00:00:00 2001 From: Sakshi Wankhade Date: Mon, 1 Jun 2026 08:44:00 +0530 Subject: [PATCH 1/2] fix: add per-widget error boundaries for dashboard widgets --- src/app/dashboard/page.tsx | 21 ++++++++++++++++----- src/components/WidgetErrorBoundary.tsx | 6 +++--- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/src/app/dashboard/page.tsx b/src/app/dashboard/page.tsx index 6f3bc2712..2feb06d43 100644 --- a/src/app/dashboard/page.tsx +++ b/src/app/dashboard/page.tsx @@ -26,6 +26,7 @@ import { authOptions } from "@/lib/auth"; import { getServerSession } from "next-auth"; import { redirect } from "next/navigation"; import DashboardSSEProvider from "@/components/DashboardSSEProvider"; +import WidgetErrorBoundary from "@/components/WidgetErrorBoundary"; const SkeletonCard = () => (
{/* Left: contribution graph + heatmap */}
- + + +
{/* Right: streak + coding time */}
- + + +
@@ -177,7 +182,9 @@ export default async function DashboardPage() { {/* -- Row 2: PR metrics + Community metrics -- */}
- + + +
@@ -248,12 +255,16 @@ export default async function DashboardPage() { {/* -- Row 4: Top repos + Language breakdown + Goal tracker -- */}
}> - + + + }> - + + +
{/* Recent activity — full width */} diff --git a/src/components/WidgetErrorBoundary.tsx b/src/components/WidgetErrorBoundary.tsx index 66c3e7efe..3ec22f2cd 100644 --- a/src/components/WidgetErrorBoundary.tsx +++ b/src/components/WidgetErrorBoundary.tsx @@ -40,11 +40,11 @@ class WidgetErrorBoundary extends React.Component { return (

- Something went wrong + Unable to load data

- +

- This widget failed to load. + Please try refreshing or try again later.