From 773ea7f93241512574d047f3fffed3503dd56a1e Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 22 Feb 2026 07:41:43 +0000 Subject: [PATCH] Address code review feedback on error pages - Move statusIcon out of ErrorBoundary render as a plain module-level function to avoid React re-creating a component type on every render - Collapse 401 action into a single descriptive button label ("Go to Home Page to Sign In") instead of a fragmented button + hint - Fix details/summary border radius collision by using overflow-hidden on the container and removing rounded-md from the summary element; separate the pre block with a border-t instead https://claude.ai/code/session_011jv8desa5vhSkjZHSjWZiV --- app/root.tsx | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/app/root.tsx b/app/root.tsx index eec21a2..ae5daa3 100644 --- a/app/root.tsx +++ b/app/root.tsx @@ -89,7 +89,6 @@ export function ErrorBoundary({ error }: Route.ErrorBoundaryProps) { let message = "An unexpected error occurred. Please try again later."; let stack: string | undefined; let showSignInHint = false; - if (isRouteErrorResponse(error)) { status = error.status; switch (error.status) { @@ -119,15 +118,6 @@ export function ErrorBoundary({ error }: Route.ErrorBoundaryProps) { stack = import.meta.env.DEV ? error.stack : undefined; } - const StatusIcon = () => { - const cls = "h-14 w-14 text-muted-foreground"; - if (status === 401) return ; - if (status === 403) return ; - if (status === 404) return ; - if (status >= 500) return ; - return ; - }; - return (
@@ -145,7 +135,7 @@ export function ErrorBoundary({ error }: Route.ErrorBoundaryProps) {
- + {statusIcon(status)}
@@ -153,26 +143,21 @@ export function ErrorBoundary({ error }: Route.ErrorBoundaryProps) {

{message}

-
+
- Go Home + {showSignInHint ? "Go to Home Page to Sign In" : "Go Home"} - {showSignInHint && ( -

- You can sign in from the home page. -

- )}
{stack && ( -
- +
+ Stack trace (development only) -
+              
                 {stack}
               
@@ -182,3 +167,12 @@ export function ErrorBoundary({ error }: Route.ErrorBoundaryProps) {
); } + +function statusIcon(status: number) { + const cls = "h-14 w-14 text-muted-foreground"; + if (status === 401) return ; + if (status === 403) return ; + if (status === 404) return ; + if (status >= 500) return ; + return ; +}