Skip to content

feat: Add Custom 404 Page (not-found.tsx)#102

Open
Atharva0506 wants to merge 1 commit intoStabilityNexus:mainfrom
Atharva0506:feat/custom-404-page
Open

feat: Add Custom 404 Page (not-found.tsx)#102
Atharva0506 wants to merge 1 commit intoStabilityNexus:mainfrom
Atharva0506:feat/custom-404-page

Conversation

@Atharva0506
Copy link
Copy Markdown

@Atharva0506 Atharva0506 commented Apr 15, 2026

Addressed Issues

Fixes #101

What Changed

Added app/not-found.tsx — Next.js automatically renders this file whenever a route is not found.

Key implementation details:

  • Reuses the existing global header structure (logo, gradient, "Submit an Article" CTA) so users don't feel disconnected from the app
  • Displays a large styled "404" heading using the project's Playfair/gradient aesthetic
  • Includes a "Go to Homepage" button with a Lucide Home icon, consistent with repo icon conventions
  • Reuses the existing <Footer /> component
  • Fully responsive — header and CTA collapse gracefully on mobile
  • Accessible: focus ring on the CTA button, semantic heading hierarchy (h2/h3), proper contrast ratios via Tailwind color choices

Screenshots/Recordings

404 Page Preview

Additional Notes

No new dependencies introduced. Uses only existing project primitives: Link (Next.js), Footer (local component), Home (Lucide), and Tailwind utility classes already present in the project.

AI Usage Disclosure

We encourage contributors to use AI tools responsibly when creating Pull Requests. While AI can be a valuable aid, it is essential to ensure that your contributions meet the task requirements, build successfully, include relevant tests, and pass all linters.

  • This PR does not contain AI-generated code at all.
  • This PR contains AI-generated code. I have read the AI Usage Policy and this PR complies with this policy.

Checklist

  • My PR addresses a single issue, fixes a single bug or makes a single improvement.
  • My code follows the project's code style and conventions
  • If applicable, I have made corresponding changes or additions to the documentation
  • If applicable, I have made corresponding changes or additions to tests
  • My changes generate no new warnings or errors
  • I have joined the Discord server and will share a link to this PR there
  • I have read the Contribution Guidelines
  • Once I submit this PR, CodeRabbit AI will automatically review it and I will address its comments
  • I have filled this PR template

Summary by CodeRabbit

  • New Features
    • Added a new custom 404 error page providing users with a better experience when navigating to non-existent pages. The page features a clear "Page Not Found" message, sticky header navigation links, and a prominent call-to-action button to return to the homepage.

@Atharva0506 Atharva0506 marked this pull request as ready for review April 15, 2026 12:22
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 15, 2026

Walkthrough

Added a new custom 404 page component (app/not-found.tsx) for Next.js that renders a styled "Page Not Found" layout. The component includes navigation links, centered messaging, a call-to-action button returning to the homepage, and reuses the existing Footer component with Tailwind styling.

Changes

Cohort / File(s) Summary
404 Not Found Page
app/not-found.tsx
New client-rendered NotFound component featuring sticky header navigation, centered 404 messaging, homepage CTA button with icon, Footer component, and Tailwind gradient/background styling.

Estimated Code Review Effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested Labels

Typescript Lang

Poem

🐰 A bunny hops by, what's this here?
A 404 page, crystal clear!
Lost travelers now find their way,
With gradients bright and buttons gay—
Home awaits at journey's end! 🏠✨

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title clearly and concisely describes the main change: adding a custom 404 page using Next.js not-found.tsx, which matches the primary objective of the changeset.
Linked Issues check ✅ Passed The PR successfully implements all coding requirements from issue #101: custom 404 page with Stable Viewpoints gradient aesthetic, responsive/accessible design, Footer component reuse, Home icon from Lucide, and clear homepage CTA button.
Out of Scope Changes check ✅ Passed The PR contains only the new not-found.tsx file with no extraneous changes, keeping the implementation focused and aligned with the single objective of adding a custom 404 page.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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
Copy Markdown
Contributor

@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: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@app/not-found.tsx`:
- Around line 38-43: Replace the semantic hierarchy so the main error message
"Page Not Found" is an h1 and the large "404" remains decorative; specifically,
swap the tags so the element currently rendering "Page Not Found" (currently an
h3) becomes h1 and the element rendering "404" (currently an h2 with the big
gradient classes) becomes non-semantic/decorative (keep the styling but change
to a non-heading element or keep h2 and add aria-hidden="true") so screen
readers treat "Page Not Found" as the primary page heading; ensure only the h1
provides the main heading role and decorative "404" is excluded from AT with
aria-hidden or role="presentation".
- Line 11: Replace the invalid Tailwind utility "border-gradient-to-r" on the
header's className with a valid border style: either use a
solid/semi-transparent Tailwind border color (e.g., replace
"border-gradient-to-r from-[`#228B22`]/20 to-[`#FFBF00`]/20" with "border
border-green-700/20" or a specific hex arbitrary value like "border-[1px]
border-[`#228B22`]/20"), or implement a gradient border via CSS using border-image
with an arbitrary value (add a custom class and define "border-image:
linear-gradient(...)" in your stylesheet) on the same header element so the
border styling is actually applied.
- Line 15: The h1's class uses multiple via-* classes which override each other;
replace the multi via-* approach with a single arbitrary background gradient
value on the same h1 (the element whose className currently starts with
"text-3xl ... bg-gradient-to-r from-[`#228B22`] via-[`#5A981A`] ...") — remove the
extra via-* classes and supply a single bg-[linear-gradient(...)] (or equivalent
arbitrary value) that includes all six color stops (from, intermediate stops,
to) while keeping bg-clip-text, text-transparent and the other typography
classes intact so the intended 6-stop gradient is rendered.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 30e2b90c-2cc3-40ff-b848-6b3dae5cfdd9

📥 Commits

Reviewing files that changed from the base of the PR and between 865ea0d and 2cbb49b.

📒 Files selected for processing (1)
  • app/not-found.tsx

Comment thread app/not-found.tsx
Comment thread app/not-found.tsx
Comment thread app/not-found.tsx
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.

[FEATURE]: Add Custom 404 Page (not-found.tsx)

1 participant