Fix/gradient background full height#138
Conversation
|
@MEHWISH310 is attempting to deploy a commit to the niharika-mente's projects Team on Vercel. A member of the Team first needs to authorize it. |
📝 WalkthroughWalkthroughThis PR renames a dynamic route parameter from ChangesRoute, Page, and Config Updates
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
package.json (1)
36-38: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueAlign
@types/react-dompinning strategy with@types/react.
@types/reactis exact-pinned to19.2.17while its companion@types/react-domuses a caret range^19. These packages are tightly coupled — a mismatched update could introduce type inconsistencies. Consider pinning@types/react-domto an exact version as well.♻️ Suggested alignment
- "`@types/react-dom`": "^19", + "`@types/react-dom`": "19.2.5",🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@package.json` around lines 36 - 38, `@types/react-dom` is using a caret range while `@types/react` is exact-pinned, which can let the companion types drift apart. Update the dependency entry in package.json so `@types/react-dom` follows the same exact pinning strategy as `@types/react`, keeping the two React type packages aligned.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@app/api/events/`[slug]/register/route.ts:
- Line 15: The route param name is misleading because `slug` in `register` is
actually treated as a MongoDB ObjectId, not the Event model’s real slug. Update
the handler in `route.ts` to use a clearer identifier for the destructured param
in the `register` route (the one currently assigned to `eventId`) and keep
`event.slug` reserved for the actual event slug used by `revalidatePath`. If you
don’t rename the param yet, add a clarifying comment near the destructuring and
validation so consumers and maintainers don’t confuse the two meanings.
- Around line 7-15: The POST handler in POST and RouteParams is placed under
app/api/ even though only GET /api/events/[slug] is allowed there. Move this
registration endpoint out of the app/api/**/route.ts structure into the
appropriate non-API location, and update any imports or callers so the POST
logic still works after relocating the route.
---
Nitpick comments:
In `@package.json`:
- Around line 36-38: `@types/react-dom` is using a caret range while
`@types/react` is exact-pinned, which can let the companion types drift apart.
Update the dependency entry in package.json so `@types/react-dom` follows the
same exact pinning strategy as `@types/react`, keeping the two React type
packages aligned.
🪄 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: CHILL
Plan: Pro
Run ID: 0897ddfe-a6c2-4c4c-82f1-54f95aa24926
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json,!package-lock.json
📒 Files selected for processing (5)
app/api/events/[slug]/register/route.tsapp/globals.cssapp/page.tsxpackage.jsontsconfig.json
Description
This PR fixes the animated gradient background so it extends across the entire scrollable height of the page, instead of cutting off after the first viewport and showing plain white background on scroll (e.g. on the Create Event page, past the "Basic Info" section).
Root cause: In
app/layout.tsx, the gradient wrapper div usesabsolute inset-0, but no ancestor (html/body) hadposition: relative. This made the div position itself relative to the viewport-sized initial containing block instead of the full document, so it was locked to exactly one screen height.Fix: Added
relativeto thebodyrule inapp/globals.css, so the gradient wrapper's containing block becomesbody(whose height is driven by the actual page content), letting the gradient stretch to the full page height. No changes were needed incomponents/LightRays.tsx— it already resizes its canvas viaResizeObserveron its container.Fixes #135
Note on second commit: While setting up the project locally to test this fix, I ran into a few pre-existing issues in
mainthat were unrelated to #135 but blocked starting at all:app/api/events/[id]andapp/api/events/[slug](Next.js requires the same param name at a given route level)export defaultinapp/page.tsx, plus dead/leftover code (const eventsdeclared twice, referencing an undefinedresolvedParams)I fixed these in a separate commit so they're easy to review or drop independently — they aren't part of the #135 scope. Happy to split them into their own issue/PR instead if you'd prefer to keep this PR focused only on the gradient fix — just let me know and I'll rebase.
Type of Change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.
Ran the app locally, navigated to the Create Event page, and scrolled down to the "Event Details" section. Confirmed the gradient background now continues across the full page instead of cutting off to plain white. Also spot-checked
/eventsand/my-bookingssince this is a global layout-level fix, not page-specific.Checklist:
Summary by CodeRabbit
New Features
Bug Fixes
Chores