Skip to content

Conversation

@megh-bari
Copy link
Contributor

@megh-bari megh-bari commented Aug 28, 2025

Description

Added a global not-found.tsx page under apps/web/app.
This ensures that whenever a user navigates to a non-existent route, they’re shown a branded 404 experience instead of the default blank/error page of next.js.

  • Implemented a clean and minimal 404 UI consistent with the Call brand theme.
  • Added metadata (title + description) for better SEO.
  • Included a Go Back Home button

Fixes: N/A


Checklist

  • I have tested my changes locally
  • I have added necessary documentation (if needed)
  • I have added/updated tests (if applicable)
  • I have run pnpm build or pnpm lint with no errors
  • This pull request is ready for review

Screenshots or UI Changes (if applicable)

Before:
No dedicated 404 page → fallback error screen.

image

After:
A centered, branded page with:

  • Large 404 heading
  • Playful copy: “Looks like you’ve wandered off the call...”
  • A single Go Back Home button
image

Related Issues

N/A


Notes for Reviewer

  • This page is global across all routes.
  • Kept copy and style light and brand-aligned.
  • Didn’t add a “Back” button to previous page, only Home button as discussed.

Summary by CodeRabbit

  • New Features
    • Introduced a custom 404 “Page Not Found” screen for the web app with clear messaging and a prominent “Go Back Home” action.
    • Full-screen, centered design for a consistent, polished experience when visiting missing or broken links.
    • Accessibility improvements: screen reader-friendly text and decorative icon handling; fast, static rendering with no data fetching.

@vercel
Copy link

vercel bot commented Aug 28, 2025

@megh-bari is attempting to deploy a commit to the cloudec31-gmailcom's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link

coderabbitai bot commented Aug 28, 2025

Walkthrough

Adds a new Next.js app router 404 page at apps/web/app/not-found.tsx, exporting page metadata and a default NotFound component that renders a centered 404 UI with title, description, and a Button-as-Link back to “/”, using lucide-react’s Undo2 icon. No data fetching; static render.

Changes

Cohort / File(s) Summary
404 Not Found page
apps/web/app/not-found.tsx
New 404 route with exported metadata (title, description) and default NotFound component rendering a full-screen 404 UI, using Link, Button asChild, and Undo2 icon; static, no data fetching.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant U as User
  participant R as Next.js App Router
  participant P as not-found.tsx (NotFound)

  U->>R: Request unknown route
  R-->>P: Render 404 page
  Note over P: Static render with metadata<br/>Title + Description + "Go Back Home"
  P-->>U: 404 HTML response
  U->>R: Click "Go Back Home" ("/")
  R-->>U: Navigate to Home
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I thump my paws—404, oh my!
A carrot-orange sign points “Home” nearby.
I hop the link with gentle cheer,
Undo2 twinkles, no need to fear.
Burrow secured, routes align—
Lost pages found, in tidy design. 🥕🐇

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • 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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbit in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbit in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbit gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbit read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbit help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbit ignore or @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbit summary or @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbit or @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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: 0

🧹 Nitpick comments (3)
apps/web/app/not-found.tsx (3)

5-9: Type the Metadata object and consider adding robots noindex; verify it’s honored in your Next.js version.

  • Add a type to catch shape regressions and include robots: { index: false } (optional; 404 status already prevents indexing).
  • Metadata in not-found.tsx is supported, but some Next 15.2.x dev builds had a metadata rendering regression; validate in production or a recent stable.

Apply inside this file:

+import type { Metadata } from "next";
 
-export const metadata = {
+export const metadata: Metadata = {
   title: "404 | Page Not Found - Call",
   description:
     "Oops! The page you’re looking for isn’t available. Head back to the homepage.",
+  robots: { index: false },
 };

Notes:

  • Root app/not-found handles unmatched URLs globally. (nextjs.org)
  • Metadata support for not-found exists (historically tracked/fixed), but a dev-only bug affected certain 15.2.x versions; confirm your version behavior. (github.com)

13-30: Add a landmark for accessibility by using

.

Provide a main landmark for screen readers.

-    <div className="min-h-screen flex bg-background items-center justify-center px-6">
+    <main className="min-h-screen flex bg-background items-center justify-center px-6" role="main">
       <div className="text-center max-w-md">
         <h1 className="text-6xl font-bold text-primary mb-6">404</h1>
         <p className="text-muted-foreground">
           Looks like you&apos;ve wandered off the call. The page you&apos;re trying to reach
-          doesn&apos;t exist or maybe it&apos;s on mute.  
+          doesn&apos;t exist or maybe it&apos;s on mute.
         </p>
         <p className="text-muted-foreground mb-8">
           Let&apos;s get you back on track.
         </p>
         <Button asChild>
           <Link href="/" className="flex items-center gap-2">
             <Undo2 className="h-4 w-4" aria-hidden="true" focusable="false" />
             <span>Go Back Home</span>
           </Link>
         </Button>
       </div>
-    </div>
+    </main>

18-18: Remove trailing whitespace.

There are extra spaces at the end of the line; most linters flag this.

-          doesn&apos;t exist or maybe it&apos;s on mute.  
+          doesn&apos;t exist or maybe it&apos;s on mute.
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between b2e98bd and b656d5d.

📒 Files selected for processing (1)
  • apps/web/app/not-found.tsx (1 hunks)
🔇 Additional comments (2)
apps/web/app/not-found.tsx (2)

11-32: Global 404 wiring looks correct.

Placing app/not-found.tsx at the app root provides a branded 404 for unmatched routes across the app. Implementation is clean and server-component friendly.

(nextjs.org)


24-28: Accessibility/readability is good here.

Using Button asChild preserves correct link semantics; the Undo2 icon is decorative with aria-hidden, and the link text is clear.

@bossadizenith
Copy link
Contributor

thanks again for another Pr @megh-bari instead of redirecting the user back to the /, you can check if they've got a session, and if so, you can redirect them to /app or if they have a history, navigate them back and if they don't have any session and history, then navigate them to the home page/route!

thanks!

@megh-bari
Copy link
Contributor Author

Hi! @code-env Thanks for the feedback on the 404 page enhancement. To implement the smart routing logic you suggested, I need to understand a few things about the current authentication setup:

What authentication system does Call use? (NextAuth.js, Clerk, Auth0, or custom?)

What's the correct API endpoint to check if a user has an active session?

Is it /api/auth/session, /api/auth/me, or something else?

What cookie names or headers should I look for to detect authentication?
For example: next-auth.session-token, __session, auth-token, etc.

Is /app the correct route for authenticated users? Or should it be /dashboard, /home, etc.?
Are there any existing utilities or hooks in the codebase I should use for checking auth state?
Like useSession(), useAuth(), or custom hooks?

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.

2 participants