From fcba787cd5433abe0e40ec4563ae4eb7c54cca85 Mon Sep 17 00:00:00 2001 From: Bryan Helmkamp Date: Mon, 2 Mar 2026 11:04:04 -0500 Subject: [PATCH] Add styled 404 and 500 error pages matching Arc design system Replace the unstyled error boundary with themed pages: teal gradient number for 404, coral for 500, centered on the atmospheric background with action buttons and a collapsible stack trace in dev mode. Co-Authored-By: Claude Opus 4.6 (1M context) --- apps/arc-web/app/root.tsx | 82 +++++++++++++++++++++++++++++++-------- 1 file changed, 66 insertions(+), 16 deletions(-) diff --git a/apps/arc-web/app/root.tsx b/apps/arc-web/app/root.tsx index ab1857fb8..4374cdeb7 100644 --- a/apps/arc-web/app/root.tsx +++ b/apps/arc-web/app/root.tsx @@ -57,29 +57,79 @@ export default function App() { } export function ErrorBoundary({ error }: Route.ErrorBoundaryProps) { - let message = "Oops!"; - let details = "An unexpected error occurred."; + let status = 500; + let heading = "Something went wrong"; + let message = "An unexpected error occurred. Please try again."; let stack: string | undefined; if (isRouteErrorResponse(error)) { - message = error.status === 404 ? "404" : "Error"; - details = - error.status === 404 - ? "The requested page could not be found." - : error.statusText || details; - } else if (import.meta.env.DEV && error && error instanceof Error) { - details = error.message; - stack = error.stack; + status = error.status; + if (status === 404) { + heading = "Page not found"; + message = "The page you're looking for doesn't exist or has been moved."; + } else { + heading = `${status} Error`; + message = error.statusText || message; + } + } else if (error instanceof Error) { + message = error.message; + if (import.meta.env.DEV) { + stack = error.stack; + } } + const is404 = status === 404; + return ( -
-

{message}

-

{details}

+
+
+

+ {status} +

+ +

+ {heading} +

+

+ {message} +

+ +
+ + Go to Runs + + +
+
+ {stack && ( -
-          {stack}
-        
+
+ + Stack trace + +
+            {stack}
+          
+
)}
);