Skip to content

feat: improved 404 page design across all apps#4438

Open
karthik-dev56 wants to merge 1 commit intobeckn:mainfrom
karthik-dev56:feat/404-page-improved
Open

feat: improved 404 page design across all apps#4438
karthik-dev56 wants to merge 1 commit intobeckn:mainfrom
karthik-dev56:feat/404-page-improved

Conversation

@karthik-dev56
Copy link

@karthik-dev56 karthik-dev56 commented Dec 12, 2025

  • Added modern, user-friendly 404 pages for all applications
  • Includes custom SVG illustration with friendly design
  • Added 'Go Back' and 'Go to Homepage' action buttons
  • Included helpful quick navigation links
  • Fully responsive and mobile-friendly design
  • Fixed TypeScript compilation errors
  • schreenshots :
  • web view:
Firefox_Screenshot_2025-12-12T07-12-05 664Z

-mobile view:
Screen Shot 2025-12-12 at 12 45 21

Summary by CodeRabbit

  • New Features
    • Introduced custom 404 error pages across all applications with centered layouts, illustrative graphics, navigation options (back button and homepage link), and helpful quick links to guide users when pages are not found.

✏️ Tip: You can customize this high-level summary in your review settings.

- Added modern, user-friendly 404 pages for all applications
- Includes custom SVG illustration with friendly design
- Added 'Go Back' and 'Go to Homepage' action buttons
- Included helpful quick navigation links
- Fully responsive and mobile-friendly design
- Fixed TypeScript compilation errors
@coderabbitai
Copy link

coderabbitai bot commented Dec 12, 2025

Walkthrough

Adds custom 404 error page components across seven Next.js applications (dhp, dsep, dsnp, industry_4.0, odr, osm, retail). Each implements a Custom404 component featuring a centered layout with SVG illustration, navigation buttons, and helpful quick links. Components use Next.js router for back navigation and provide homepage links.

Changes

Cohort / File(s) Summary
Custom 404 Pages
apps/dhp/pages/404.tsx, apps/dsep/pages/404.tsx, apps/dsnp/pages/404.tsx, apps/industry_4.0/pages/404.tsx, apps/odr/pages/404.tsx, apps/osm/pages/404.tsx, apps/retail/pages/404.tsx
New Next.js 404 page components added to each application. Each exports a Custom404 functional component featuring centered layout with decorative SVG, "Page Not Found" heading, Go Back button (router.back), Go to Homepage link, and quick navigation links. Styled with Tailwind CSS utility classes for responsive layout.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

  • Review effort is reduced due to homogeneous, repetitive pattern applied consistently across all 7 files
  • Each file follows identical component structure and styling approach
  • Verify consistency of layout, button handlers (router.back()), and link destinations across all apps
  • Confirm SVG illustrations and help link content align with each app's context (retail includes "Order History" and "Cart", while others include "Home" and "Search")

Poem

🐰 Seven apps, seven pages lost,
Now 404s elegantly dressed!
With helpful links and buttons bright,
Lost users find their way to light.
Hoppy trails lead travelers home! 🏠

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adding improved 404 page components across multiple applications with modern design features.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (13)
apps/odr/pages/404.tsx (2)

1-3: Use next/link for internal navigation + consider fallback when router.back() is ineffective

<a href> forces full reloads and can bypass Next routing/basePath; also router.back() may do nothing if the user landed directly on the 404 (no history). Consider:

 import React from 'react'
 import { useRouter } from 'next/router'
+import Link from 'next/link'

 const Custom404 = () => {
   const router = useRouter()
+  const handleGoBack = () => {
+    if (typeof window !== 'undefined' && window.history.length > 1) router.back()
+    else router.push('/')
+  }

   return (
@@
-          <button
-            onClick={() => router.back()}
+          <button
+            type="button"
+            onClick={handleGoBack}
             className="px-6 py-3 bg-white text-indigo-600 border-2 border-indigo-600 rounded-lg font-semibold hover:bg-indigo-50 transition-colors duration-200"
           >
             Go Back
           </button>
-          <a
-            href="/"
+          <Link
+            href="/"
             className="px-6 py-3 bg-indigo-600 text-white rounded-lg font-semibold hover:bg-indigo-700 transition-colors duration-200 inline-block"
           >
             Go to Homepage
-          </a>
+          </Link>
@@
-            <a href="/" className="text-indigo-600 hover:text-indigo-800 hover:underline">
+            <Link href="/" className="text-indigo-600 hover:text-indigo-800 hover:underline">
               Home
-            </a>
-            <a href="/search" className="text-indigo-600 hover:text-indigo-800 hover:underline">
+            </Link>
+            <Link href="/search" className="text-indigo-600 hover:text-indigo-800 hover:underline">
               Search
-            </a>
+            </Link>

Also applies to: 84-116


14-19: Mark the SVG as decorative (a11y) to avoid screen reader noise

Since the SVG is decorative, consider:

             <svg
               className="w-full h-48 mx-auto"
               viewBox="0 0 200 200"
               fill="none"
               xmlns="http://www.w3.org/2000/svg"
+              aria-hidden="true"
+              focusable="false"
             >
apps/industry_4.0/pages/404.tsx (2)

1-3: Prefer next/link for internal links + add router.back() fallback

Same recommendation as other apps: use Link for internal navigation and consider a fallback to router.push('/') when back() can’t navigate (direct-entry 404). (See diff pattern in apps/odr/pages/404.tsx.)

Also applies to: 84-116


14-19: Decorative SVG should be aria-hidden

Add aria-hidden="true" and focusable="false" to the <svg> to reduce assistive-tech noise.

apps/dsnp/pages/404.tsx (2)

1-3: Swap <a href> to next/link (client routing) + back fallback

Internal navigation should generally use Link to avoid full reloads and handle basePath; also consider a “back” fallback to / when there’s no history entry.

Also applies to: 84-116


14-19: SVG a11y: set decorative semantics

Add aria-hidden="true" (or add <title>/<desc> + role="img" if you want it announced).

apps/retail/pages/404.tsx (1)

14-19: Decorative SVG: add aria-hidden

Mark the illustration as decorative (aria-hidden="true", focusable="false").

apps/osm/pages/404.tsx (2)

1-3: Use next/link + add a safer “Go Back” handler

Recommend Link for internal routes and a back() fallback to / when there’s no history entry (direct 404).

Also applies to: 84-116


14-19: SVG a11y: mark as decorative

Add aria-hidden="true" + focusable="false" to the <svg>.

apps/dsep/pages/404.tsx (2)

1-3: Prefer next/link and avoid full page reloads for internal links

Switch internal <a href> to Link (home/helpful links) to keep SPA navigation behavior and basePath handling.

Also applies to: 84-116


86-91: Add type="button" on the “Go Back” button

Prevents unintended submit behavior if this component ever gets rendered inside a <form>.

apps/dhp/pages/404.tsx (2)

14-19: SVG a11y: mark as decorative

Add aria-hidden="true" + focusable="false" on the <svg> (or provide accessible title/desc if it’s meant to be announced).


84-128: Use Link from next/link for internal navigation instead of <a href> tags.

The routes /myAppointments and /cart are valid and correctly cased. However, for consistency with other pages in the dhp app and Next.js best practices, import and use Link for all internal navigation links rather than <a href> elements. This applies to the links pointing to "/", "/search", "/myAppointments", and "/cart".

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0ac0865 and 7e1c678.

📒 Files selected for processing (7)
  • apps/dhp/pages/404.tsx (1 hunks)
  • apps/dsep/pages/404.tsx (1 hunks)
  • apps/dsnp/pages/404.tsx (1 hunks)
  • apps/industry_4.0/pages/404.tsx (1 hunks)
  • apps/odr/pages/404.tsx (1 hunks)
  • apps/osm/pages/404.tsx (1 hunks)
  • apps/retail/pages/404.tsx (1 hunks)

Comment on lines +84 to +128
{/* Action Buttons */}
<div className="flex flex-col sm:flex-row gap-4 justify-center">
<button
onClick={() => router.back()}
className="px-6 py-3 bg-white text-indigo-600 border-2 border-indigo-600 rounded-lg font-semibold hover:bg-indigo-50 transition-colors duration-200"
>
Go Back
</button>
<a
href="/"
className="px-6 py-3 bg-indigo-600 text-white rounded-lg font-semibold hover:bg-indigo-700 transition-colors duration-200 inline-block"
>
Go to Homepage
</a>
</div>

{/* Helpful Links */}
<div className="mt-12">
<p className="text-sm text-gray-500 mb-3">Need help? Try these:</p>
<div className="flex flex-wrap justify-center gap-4 text-sm">
<a
href="/"
className="text-indigo-600 hover:text-indigo-800 hover:underline"
>
Home
</a>
<a
href="/search"
className="text-indigo-600 hover:text-indigo-800 hover:underline"
>
Search
</a>
<a
href="/orderHistory"
className="text-indigo-600 hover:text-indigo-800 hover:underline"
>
Order History
</a>
<a
href="/cart"
className="text-indigo-600 hover:text-indigo-800 hover:underline"
>
Cart
</a>
</div>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

# First, find the pages directory structure in the retail app
find apps/retail/pages -type f -name "*.tsx" -o -name "*.ts" -o -name "*.jsx" -o -name "*.js" | head -50

Repository: beckn/beckn-ui-workspace

Length of output: 754


🏁 Script executed:

cat -n apps/retail/pages/404.tsx | head -100

Repository: beckn/beckn-ui-workspace

Length of output: 3801


🏁 Script executed:

cat -n apps/retail/pages/404.tsx | tail -30

Repository: beckn/beckn-ui-workspace

Length of output: 1032


Use next/link for internal navigation instead of raw <a> tags

The routes /, /search, /orderHistory, and /cart are correct (they match the existing page files). However, for Next.js best practices, replace all <a href> tags pointing to internal routes with next/link. Import Link from next/link and update the navigation links in both the action buttons section and the helpful links section.

🤖 Prompt for AI Agents
In apps/retail/pages/404.tsx around lines 84 to 128, internal navigation is
using raw <a href> anchors; import Link from 'next/link' and replace those
anchors with Next.js Link components for client-side routing (wrap the existing
button and link elements in <Link href="..."> or make the Link the element and
keep the className on the child), updating the action button that goes to "/"
and all helpful links ("/", "/search", "/orderHistory", "/cart") to use Link so
Next handles navigation; ensure you add the Link import at the top of the file
and preserve existing className and accessibility attributes when replacing the
anchors.

@karthik-dev56
Copy link
Author

karthik-dev56 commented Dec 12, 2025

I have started my first contribution with this please look at out and Mobile view also clearly responsive screenshot i have taken its looking like that but it is also full responsive

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant