Skip to content

feat(web): add error and not-found UI; align CONTRIBUTING with develop#127

Open
mooncitydev wants to merge 1 commit intoPACTO-LAT:developfrom
mooncitydev:feat/error-not-found-and-contributing-docs
Open

feat(web): add error and not-found UI; align CONTRIBUTING with develop#127
mooncitydev wants to merge 1 commit intoPACTO-LAT:developfrom
mooncitydev:feat/error-not-found-and-contributing-docs

Conversation

@mooncitydev
Copy link
Copy Markdown

@mooncitydev mooncitydev commented Mar 28, 2026

  • Add App Router error.tsx with reset and home navigation

  • Add not-found.tsx for consistent 404 experience

  • Document upstream URL, rebase target develop, and testing note

Summary by CodeRabbit

  • New Features
    • Added error handling page that displays when unexpected application issues occur, with "Try again" button to recover and home navigation link.
    • Added page not found (404) page displayed when users navigate to non-existent routes, with quick navigation back to home.

- Add App Router error.tsx with reset and home navigation

- Add not-found.tsx for consistent 404 experience

- Document upstream URL, rebase target develop, and testing note
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 28, 2026

@mooncitydev is attempting to deploy a commit to the aguilar1x's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 28, 2026

📝 Walkthrough

Walkthrough

Updated contributor workflow documentation to reflect a new repository owner and development branch, plus added two new Next.js error-handling page components for displaying error states and 404 not-found pages with user-friendly messaging and navigation controls.

Changes

Cohort / File(s) Summary
Documentation
CONTRIBUTING.md
Updated upstream remote URL to new repository owner, changed branch base from main to develop, adjusted rebase and PR conflict resolution guidance accordingly, and replaced detailed test command list with streamlined pre-PR checks (type-check, biome:check, build).
Next.js Error Pages
apps/web/app/error.tsx, apps/web/app/not-found.tsx
Added client-side error page component with error logging and reset functionality; added not-found page component with navigation back to home; both include icon, messaging, and action controls.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A doc refresh hops through our paths,
New error pages soothe the wrath,
When pages vanish, fear not the plight,
For home's just a click, shining bright!
Repository bounces to better ground,
Where develop shall thrive, and bugs be found. 🌱

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the three main changes: adding error and not-found UI components to the web app, and updating CONTRIBUTING documentation to align with the develop branch.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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

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

🧹 Nitpick comments (4)
CONTRIBUTING.md (1)

307-307: Include biome:format in the final pre-PR checks for consistency.

Line 307 references checks from “Making Changes” but currently lists only type-check, biome:check, and build. Consider adding biome:format here too so this section matches the repo’s commit hygiene guidance.

Based on learnings: Run npm run biome:format before committing.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@CONTRIBUTING.md` at line 307, Update the "Making Changes" pre-PR checklist to
include the formatting step by adding `biome:format` alongside `type-check`,
`biome:check`, and `build` (the referenced checks at line 307); ensure the
README/CONTRIBUTING text instructs contributors to run `npm run biome:format`
before committing and mention it in the PR checklist so docs and the repo's
commit hygiene guidance remain consistent.
apps/web/app/error.tsx (2)

33-33: Use a named handle* event handler instead of an inline callback.

This keeps JSX cleaner and aligns with the repository handler naming rule.

♻️ Suggested refactor
+  const handleRetry = (): void => {
+    reset();
+  };
+
   return (
@@
-          <Button type="button" onClick={() => reset()}>
+          <Button type="button" onClick={handleRetry}>
             Try again
           </Button>

As per coding guidelines, **/*.{jsx,tsx}: Event handlers should start with 'handle' prefix (e.g., handleClick, handleSubmit).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/web/app/error.tsx` at line 33, Replace the inline callback on the Button
with a named handler: create a function named handleReset (or similar starting
with "handle") near the component body that calls reset(), then change onClick
to reference handleReset (i.e., onClick={handleReset}); ensure the handler is
defined in the same component scope so it can access the existing reset symbol
and keeps JSX cleaner and compliant with the handler naming rule.

8-14: Prefer an interface + typed const arrow component for consistency.

Switching from a function declaration with inline props to a typed const arrow aligns with the TS/TSX conventions used in this repo.

♻️ Suggested refactor
-export default function ErrorPage({
-  error,
-  reset,
-}: {
-  error: Error & { digest?: string };
-  reset: () => void;
-}) {
+interface ErrorPageProps {
+  error: Error & { digest?: string };
+  reset: () => void;
+}
+
+const ErrorPage = ({ error, reset }: ErrorPageProps): JSX.Element => {
@@
-}
+};
+
+export default ErrorPage;

As per coding guidelines, **/*.{ts,tsx}: Prefer const arrow functions with explicit type annotations over function declarations.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/web/app/error.tsx` around lines 8 - 14, Replace the function declaration
ErrorPage with a typed const arrow component: define an interface (e.g.,
ErrorPageProps) that describes error: Error & { digest?: string } and reset: ()
=> void, then export default a const ErrorPage with an explicit React/TSX type
(e.g., React.FC<ErrorPageProps> or (props: ErrorPageProps) => JSX.Element) and
destructure { error, reset } in the parameter list; keep the component body
unchanged and ensure the default export remains on the const.
apps/web/app/not-found.tsx (1)

5-5: Use a typed const arrow component for TSX consistency.

The current component works, but a typed const arrow better matches repo conventions.

♻️ Suggested refactor
-export default function NotFoundPage() {
+const NotFoundPage = (): JSX.Element => {
   return (
@@
-}
+};
+
+export default NotFoundPage;

As per coding guidelines, **/*.{ts,tsx}: Prefer const arrow functions with explicit type annotations over function declarations.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/web/app/not-found.tsx` at line 5, The NotFoundPage export is a plain
function declaration; convert it to a typed const arrow component to match repo
TSX conventions: replace the function declaration for NotFoundPage with a const
arrow assigned to an explicit React component type (e.g., const NotFoundPage:
React.FC = () => { ... }) and keep it as the default export so the component
shape and typing are explicit.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@apps/web/app/error.tsx`:
- Around line 29-31: Replace direct rendering of error.message in the error UI
with a generic user-facing string and move the detailed error text to
logs/monitoring: in apps/web/app/error.tsx stop rendering {error.message || ...}
and instead render a fixed friendly message like "Something went wrong. Please
try again."; concurrently call your logging function (e.g., console.error(error)
or a central logger/monitoring function) to capture error.message and stack for
debugging, and if you want to display details only in development wrap the
original message render behind a NODE_ENV === 'development' check (use the error
variable and the JSX paragraph that currently renders error.message).

In `@CONTRIBUTING.md`:
- Around line 96-99: Update the branch-creation instructions so the new feature
branch is explicitly based on develop: before the existing git checkout -b
feature/your-feature-name step, add an explicit git checkout develop and a git
pull upstream develop (or equivalent sync) to ensure your local develop is
up-to-date; then run git checkout -b feature/your-feature-name as shown.

---

Nitpick comments:
In `@apps/web/app/error.tsx`:
- Line 33: Replace the inline callback on the Button with a named handler:
create a function named handleReset (or similar starting with "handle") near the
component body that calls reset(), then change onClick to reference handleReset
(i.e., onClick={handleReset}); ensure the handler is defined in the same
component scope so it can access the existing reset symbol and keeps JSX cleaner
and compliant with the handler naming rule.
- Around line 8-14: Replace the function declaration ErrorPage with a typed
const arrow component: define an interface (e.g., ErrorPageProps) that describes
error: Error & { digest?: string } and reset: () => void, then export default a
const ErrorPage with an explicit React/TSX type (e.g., React.FC<ErrorPageProps>
or (props: ErrorPageProps) => JSX.Element) and destructure { error, reset } in
the parameter list; keep the component body unchanged and ensure the default
export remains on the const.

In `@apps/web/app/not-found.tsx`:
- Line 5: The NotFoundPage export is a plain function declaration; convert it to
a typed const arrow component to match repo TSX conventions: replace the
function declaration for NotFoundPage with a const arrow assigned to an explicit
React component type (e.g., const NotFoundPage: React.FC = () => { ... }) and
keep it as the default export so the component shape and typing are explicit.

In `@CONTRIBUTING.md`:
- Line 307: Update the "Making Changes" pre-PR checklist to include the
formatting step by adding `biome:format` alongside `type-check`, `biome:check`,
and `build` (the referenced checks at line 307); ensure the README/CONTRIBUTING
text instructs contributors to run `npm run biome:format` before committing and
mention it in the PR checklist so docs and the repo's commit hygiene guidance
remain consistent.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: b8964fbc-c4e0-466f-9692-03fd12d95114

📥 Commits

Reviewing files that changed from the base of the PR and between 0de524c and 1d0a6e3.

📒 Files selected for processing (3)
  • CONTRIBUTING.md
  • apps/web/app/error.tsx
  • apps/web/app/not-found.tsx

Comment on lines +29 to +31
<p className="mb-6 text-sm text-muted-foreground">
{error.message || 'An unexpected error occurred. Please try again.'}
</p>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Avoid rendering raw error.message directly in production UI.

Displaying the raw error text can leak internal implementation details. Prefer a generic user message and keep detailed error info in logs/monitoring.

🔧 Suggested hardening
+  const userMessage = 'An unexpected error occurred. Please try again.';
+
   return (
@@
         <p className="mb-6 text-sm text-muted-foreground">
-          {error.message || 'An unexpected error occurred. Please try again.'}
+          {userMessage}
         </p>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/web/app/error.tsx` around lines 29 - 31, Replace direct rendering of
error.message in the error UI with a generic user-facing string and move the
detailed error text to logs/monitoring: in apps/web/app/error.tsx stop rendering
{error.message || ...} and instead render a fixed friendly message like
"Something went wrong. Please try again."; concurrently call your logging
function (e.g., console.error(error) or a central logger/monitoring function) to
capture error.message and stack for debugging, and if you want to display
details only in development wrap the original message render behind a NODE_ENV
=== 'development' check (use the error variable and the JSX paragraph that
currently renders error.message).

Comment on lines +96 to 99
1. **Create a new branch** from `develop` (the default integration branch):
```bash
git checkout -b feature/your-feature-name
```
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Make branch creation explicitly start from develop.

Line 96 says “from develop”, but the command in Lines 97–99 creates a branch from the current HEAD. Add an explicit checkout/sync step for develop to avoid accidental wrong-base branches.

Suggested doc fix
-1. **Create a new branch** from `develop` (the default integration branch):
+1. **Create a new branch** from `develop` (the default integration branch):
    ```bash
+   git checkout develop
+   git pull upstream develop
    git checkout -b feature/your-feature-name
    ```
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@CONTRIBUTING.md` around lines 96 - 99, Update the branch-creation
instructions so the new feature branch is explicitly based on develop: before
the existing git checkout -b feature/your-feature-name step, add an explicit git
checkout develop and a git pull upstream develop (or equivalent sync) to ensure
your local develop is up-to-date; then run git checkout -b
feature/your-feature-name as shown.

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