OpenCut icon indicating copy to clipboard operation
OpenCut copied to clipboard

feat: added a 404 page so users don’t get too lost and can escape the…

Open megh-bari opened this issue 1 year ago • 5 comments

… dreaded 404 abyss

Description

This PR implements a custom 404 (Page Not Found) page with a “Go Back To Home” button to replace the default Next.js error page. The new page provides a branded user experience that aligns with OpenCut's design system and offers clear navigation back to the main application. it help users easily return to the homepage when they hit a missing page.

Previously, users encountering non-existent routes would see a generic browser/Next.js error page. This custom implementation maintains brand consistency and provides a better user experience with helpful navigation options.


Screenshots

Laptop View

image

Mobile View

image

Type of change

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [x] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [ ] This change requires a documentation update

How Has This Been Tested?

  • [x] Manually tested that the 404 page displays correctly and the “Go Back To Home” button redirects to the homepage.
  • [x] Responsive design: Verified layout works on mobile and desktop viewports
  • [x] Navigation functionality: Confirmed "Go Home" button redirects to main page
  • [x] Image loading: Tested custom 404 image loads correctly

Test Configuration:

  • Node version: v22.12.0
  • Browser: Chrome/Brave
  • Operating System: Windows

Test Steps:

  1. Run bun dev
  2. Navigate to http://localhost:3000/non-existent-page
  3. Verify custom 404 page displays with proper styling
  4. Click "Go Home" button to test navigation
  5. Test on different screen sizes for responsiveness

Checklist:

  • [x] My code follows the style guidelines of this project
  • [x] I have performed a self-review of my code
  • [x] I have added screenshots if ui has been changed
  • [x] I have commented my code, particularly in hard-to-understand areas
  • [x] I have made corresponding changes to the documentation
  • [x] My changes generate no new warnings
  • [ ] I have added tests that prove my fix is effective or that my feature works
  • [x] New and existing unit tests pass locally with my changes
  • [x] Any dependent changes have been merged and published in downstream modules

Additional context

This update improves user experience by guiding users from dead-end pages back to the homepage quickly.

Design Decisions:

  • Used Next.js app router convention with not-found.tsx for automatic 404 handling
  • Implemented custom image with optimal visibility
  • Leveraged existing UI components (Button, Lucide icons) for consistency
  • Followed project's Tailwind CSS patterns for styling

Files Added:

  • src/app/not-found.tsx - Custom 404 page component
  • public/images/404-custom.png - Branded 404 image asset

This contribution aligns with the project's contribution guidelines, focusing on UI/UX improvements while avoiding the preview system area scheduled for refactoring.

Summary by CodeRabbit

  • New Features
    • Introduced a dedicated 404 “Page Not Found” experience for invalid URLs.
    • Provides clear page title and description for improved SEO and sharing.
    • Full-screen, centered layout with a custom illustration and friendly guidance.
    • Prominent “Go Back to Home” button with recognizable icon for quick recovery.
    • Responsive design aligned with existing branding for a seamless look and feel.

megh-bari avatar Aug 17 '25 20:08 megh-bari

@megh-bari is attempting to deploy a commit to the OpenCut OSS Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Aug 17 '25 20:08 vercel[bot]

Deploy request for appcut pending review.

Visit the deploys page to approve it

Name Link
Latest commit 03f9ebede870ef780780ee4607be44bcf7784b5f

netlify avatar Aug 17 '25 20:08 netlify

Walkthrough

Adds a Next.js App Router NotFound page at apps/web/src/app/not-found.tsx, exporting metadata (title, description) and a default NotFound component that renders a full-screen 404 view with a custom image and a button linking to the homepage.

Changes

Cohort / File(s) Change Summary
NotFound Page
apps/web/src/app/not-found.tsx
New App Router 404 page added. Exports metadata (title, description) and default NotFound component. Uses next/image, next/link, a UI Button, and lucide-react Undo2 icon; renders centered 404 UI with 404-custom.png and a "Go Back To Home" action.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant NextAppRouter as Next.js App Router
  participant NotFound as not-found.tsx
  participant Home as "/"

  User->>NextAppRouter: Request unknown route
  NextAppRouter->>NotFound: Render NotFound page
  NotFound-->>User: Display 404 view with image and button
  User->>NotFound: Click "Go Back To Home"
  NotFound->>Home: Navigate to "/"
  Home-->>User: Render homepage

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I twitch my whiskers at a missing way,
A painted 404 where lost links stray.
With a hop and a button, homeward I glide,
Undo2 winks — the path restored with pride. 🥕

[!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.


📜 Recent 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 a9a0b83703ed9c13f4d84907637d7e2aba9ab81f and 03f9ebede870ef780780ee4607be44bcf7784b5f.

📒 Files selected for processing (1)
  • apps/web/src/app/not-found.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/web/src/app/not-found.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Vade Review
✨ 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 @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai 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:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai 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 @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @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.

coderabbitai[bot] avatar Aug 17 '25 20:08 coderabbitai[bot]

I'm confused about line 9 in not-found.tsx, what do you mean by "or continue exploring OpenCut"?

enkei64 avatar Aug 18 '25 10:08 enkei64

I'm confused about line 9 in not-found.tsx, what do you mean by "or continue exploring OpenCut"?

Just add it casually, nothing else. It means both "Go to Home Page" and " Continue Explore OpenCut" take you to the homepage, where you can explore. It’s just a description for metadata bruh

megh-bari avatar Aug 18 '25 10:08 megh-bari