Skip to content

Dev#192

Merged
afsar-dev merged 14 commits into
mainfrom
dev
Jul 2, 2026
Merged

Dev#192
afsar-dev merged 14 commits into
mainfrom
dev

Conversation

@afsar-dev

@afsar-dev afsar-dev commented Jul 2, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • Bug Fixes
    • Improved docs page handling for invalid or missing page slugs, showing a not-found state instead of failing unexpectedly.
    • Tightened slug validation to block unsupported path inputs.
    • Fixed several animated cursor and hero effects to stop cleanly when the component unmounts, reducing runaway animations and resource usage.

@vercel

vercel Bot commented Jul 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nurui Ready Ready Preview, Comment, Open in v0 Jul 2, 2026 9:20am

@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 44ad86ee-5bab-459f-bbaf-eccbd85502b9

📥 Commits

Reviewing files that changed from the base of the PR and between d5730bd and cc8ab94.

📒 Files selected for processing (10)
  • src/app/(docs)/docs/[slug]/page.tsx
  • src/components/nurui/canvas-cursor.tsx
  • src/components/nurui/code-cursor.tsx
  • src/components/nurui/digital-hero.tsx
  • src/components/nurui/electric-cursor.tsx
  • src/components/nurui/fire-cursor.tsx
  • src/components/nurui/ghost-cursor.tsx
  • src/components/nurui/gradient-grid-hero.tsx
  • src/components/nurui/shader-canvas.tsx
  • src/components/nurui/splash-cursor.tsx

📝 Walkthrough

Walkthrough

This PR adds slug whitelist validation and safe ENOENT-based 404 handling for docs MDX file loading, and updates several nurui canvas components to track requestAnimationFrame handles for proper cancellation on cleanup, plus refactors inline event listeners into named handler functions.

Changes

Docs Slug Validation

Layer / File(s) Summary
Slug validation and safe MDX loading
src/app/(docs)/docs/[slug]/page.tsx
Adds notFound import, whitelist validation for the slug param, and try/catch handling around MDX file reads that returns 404 on ENOENT and rethrows other errors, applied in both generateMetadata and the page component.

Canvas Animation Lifecycle Fixes

Layer / File(s) Summary
CanvasCursor cleanup and listener refactor
src/components/nurui/canvas-cursor.tsx
Captures renderCanvas()'s cleanup function for unmount, extracts pointer helpers to module scope, and expands cleanup to remove all attached listeners including focus/blur.
Animation frame tracking in simple cursors
src/components/nurui/code-cursor.tsx, src/components/nurui/digital-hero.tsx, src/components/nurui/electric-cursor.tsx, src/components/nurui/fire-cursor.tsx, src/components/nurui/ghost-cursor.tsx
Introduces animationId variables to track scheduled requestAnimationFrame calls and adds cancelAnimationFrame in effect cleanups.
Gradient/shader named handlers and frame tracking
src/components/nurui/gradient-grid-hero.tsx, src/components/nurui/shader-canvas.tsx
Extracts a named mousemove handler, tracks animation frame IDs for cancellation, and reformats shader compilation error/argument formatting.
SplashCursor named handlers and cleanup
src/components/nurui/splash-cursor.tsx
Replaces inline mouse/touch listeners with named handler functions and tracks the render loop's animationId for cancellation during cleanup.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant Page
  participant FileSystem

  Client->>Page: request /docs/[slug]
  Page->>Page: validate slug against whitelist
  alt slug invalid
    Page->>Client: notFound()
  else slug valid
    Page->>FileSystem: readFile(content/docs/slug.mdx)
    alt file missing (ENOENT)
      FileSystem-->>Page: ENOENT error
      Page->>Client: notFound()
    else file exists
      FileSystem-->>Page: MDX content
      Page->>Client: render content
    end
  end
Loading
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration.


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.

@afsar-dev
afsar-dev merged commit eb0275b into main Jul 2, 2026
5 of 6 checks passed
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