From b2cb3717e5db222a80ace89c0d5b41eeceff22be Mon Sep 17 00:00:00 2001 From: Sojan Jose Date: Wed, 11 Feb 2026 07:57:00 -0800 Subject: [PATCH] fix: Replace default Rails error pages with custom designs (#13514) ## Summary - Replace generic Rails 404, 422, and 500 error pages with custom-designed pages - Each page features a prominent gradient error code, clean typography, and a "Back to home" CTA - Full dark mode support via `prefers-color-scheme` media query - Mobile responsive design - No external dependencies (self-contained static HTML, works even when Rails is down) - No logo/branding to ensure compatibility with custom-branded self-hosted instances --- ## Before (default Rails 404) old-404 --- ## After ### Light mode | 404 | 422 | 500 | |-----|-----|-----| | new-404-light | new-422-light | new-500-light | --- ### Dark mode | 404 | 422 | 500 | |-----|-----|-----| | new-404-dark | new-422-dark | new-500-dark | --- ## Test plan Easier way to verify: - [ ] Visit `/404.html` directly to verify the 404 page - [ ] Visit `/422.html` directly to verify the 422 page - [ ] Visit `/500.html` directly to verify the 500 page Full verification: - [ ] Visit a non-existent route in production mode to verify the 404 page - [ ] Trigger a 422 error (e.g., invalid CSRF token) to verify the 422 page - [ ] Trigger a 500 error to verify the 500 page - [ ] Toggle system dark mode and verify all pages render correctly - [ ] Test on mobile viewport widths --- public/404.html | 155 +++++++++++++++++++++++++++++----------------- public/422.html | 160 +++++++++++++++++++++++++++++++----------------- public/500.html | 154 +++++++++++++++++++++++++++++----------------- 3 files changed, 299 insertions(+), 170 deletions(-) diff --git a/public/404.html b/public/404.html index b612547fc..d48579082 100644 --- a/public/404.html +++ b/public/404.html @@ -1,67 +1,108 @@ - + - The page you were looking for doesn't exist (404) + + Page not found - - -
-
-

The page you were looking for doesn't exist.

-

You may have mistyped the address or the page may have moved.

-
-

If you are the application owner check the logs for more information.

+
+
404
+

Page not found

+

The page you're looking for doesn't exist or has been moved.

+ + + Back to home + +
+

If you think this is a mistake, please reach out to support.

diff --git a/public/422.html b/public/422.html index a21f82b3b..2d7ed0bb7 100644 --- a/public/422.html +++ b/public/422.html @@ -1,67 +1,113 @@ - + - The change you wanted was rejected (422) + + Request rejected - - -
-
-

The change you wanted was rejected.

-

Maybe you tried to change something you didn't have access to.

-
-

If you are the application owner check the logs for more information.

+
+
422
+

Request rejected

+

Your request couldn't be processed due to a security verification failure or invalid data.

+ + + Back to home + +
+

If this keeps happening, try clearing your cookies and refreshing.

diff --git a/public/500.html b/public/500.html index 061abc587..1339c166b 100644 --- a/public/500.html +++ b/public/500.html @@ -1,66 +1,108 @@ - + - We're sorry, but something went wrong (500) + + Something went wrong - - -
-
-

We're sorry, but something went wrong.

-
-

If you are the application owner check the logs for more information.

+
+
500
+

Something went wrong

+

An unexpected error occurred. Please refresh the page or try again shortly.

+ + + Back to home + +
+

If the problem persists, please try again in a few minutes.