Skip to content

Conversation

@aniket866
Copy link

@aniket866 aniket866 commented Feb 9, 2026

Closes #29
screen-capture (23).webm
@KanishkSogani Please review

Summary by CodeRabbit

  • New Features

    • Mobile menu redesigned as a half-sheet interface with backdrop overlay.
    • Body scroll is locked when the mobile menu is open.
    • Hamburger menu button added for mobile navigation.
  • Improvements

    • Navbar simplified with consistent scroll-based styling.
    • Mobile menu content streamlined for improved user experience.

@coderabbitai
Copy link

coderabbitai bot commented Feb 9, 2026

Warning

Rate limit exceeded

@aniket866 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 17 minutes and 24 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📝 Walkthrough

Walkthrough

The Navbar component is refactored from a complex multi-state desktop/mobile architecture to a simplified design featuring a mobile half-sheet menu. State management is consolidated, a backdrop and scroll-locking mechanism are introduced, and navigation logic is streamlined with minimal fixed navbar elements for desktop and a hamburger-triggered sheet for mobile.

Changes

Cohort / File(s) Summary
Navbar Component Redesign
web/src/components/Navbar.tsx
Refactors navbar from multi-state structure to simplified mobile half-sheet pattern. Introduces NAVY_BG and SHEET_HEIGHT constants, adds backdrop with body scroll locking for mobile sheet, replaces conditional scroll-based styling with consistent scrolled state, streamlines header rendering with minimal fixed navbar and hamburger menu button for mobile, consolidates wallet and navigation interactions into single sheet flow, removes obsolete mobile navigation elements and dynamic link logic.

Sequence Diagram(s)

sequenceDiagram
    actor User
    participant NavBar as Navbar Component
    participant Sheet as Mobile Sheet Menu
    participant Backdrop
    participant Body as Body Element
    participant Action as Navigation/Wallet Action

    User->>NavBar: Tap hamburger menu button
    NavBar->>NavBar: Set open = true
    NavBar->>Backdrop: Render backdrop
    NavBar->>Body: Lock scroll
    Backdrop->>Backdrop: Display with overlay
    
    rect rgba(100, 200, 255, 0.5)
        Note over Sheet: Sheet is now visible
        User->>Sheet: View nav links / wallet section
        User->>Sheet: Interact with menu item or button
        Sheet->>Action: Trigger navigation or wallet config
    end
    
    User->>Backdrop: Tap backdrop OR action completes
    NavBar->>NavBar: Set open = false
    NavBar->>Backdrop: Hide backdrop
    NavBar->>Body: Unlock scroll
    Backdrop->>Backdrop: Disappear
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐰 A tale of menus, half and wide,
Where modals hide on mobile's side,
The backdrop blooms, the scroll locks tight,
Now layering's fixed—a hamburger's right!
From chaos bloomed a sheet so neat,

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 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 main change: fixing the hamburger dropdown's lack of background coverage that was causing overlapping issues with the homepage content.
Linked Issues check ✅ Passed The PR successfully implements the required fix by introducing a backdrop when the mobile sheet is open, proper layering with semi-modal half-sheet design, and body scroll locking during sheet visibility to prevent content overlap.
Out of Scope Changes check ✅ Passed All changes are directly related to fixing the hamburger dropdown backdrop and layering issue: navbar restructuring, mobile sheet implementation, and backdrop introduction address the reported problem without introducing unrelated modifications.
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
  • 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

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@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

🤖 Fix all issues with AI agents
In `@web/src/components/Navbar.tsx`:
- Around line 31-37: The useEffect that manages the scroll listener currently
runs only when isLanding is true, causing scrolled to remain stale on
non-landing pages; update the effect in Navbar (the useEffect that references
isLanding, setScrolled and window.addEventListener/ removeEventListener) to:
when isLanding is true attach the scroll listener as before, and when isLanding
is false immediately setScrolled(true) (and ensure no dangling listener is
attached), or alternatively always attach the scroll listener but default
scrolled to true for non-landing pages; make the change for both the first
effect (lines ~31-37) and the similar block around lines ~55-60 so non-landing
routes always render a solid background.
- Around line 22-28: The sheet's open state isn't reset on client-side
navigation; add an effect that closes the menu whenever the route changes by
using useEffect(() => setOpen(false), [pathname]) in the Navbar component
(references: open, setOpen, usePathname) so any navigation (back/forward or
link) will setOpen(false) and unlock body scroll on the new page.
🧹 Nitpick comments (3)
web/src/components/Navbar.tsx (3)

68-73: Add aria-label to the hamburger and close buttons for accessibility.

Screen readers can't determine the purpose of icon-only buttons without labels.

Proposed fix
         <button
           onClick={() => setOpen(true)}
-          className="md:hidden text-white p-2"
+          className="md:hidden text-white p-2"
+          aria-label="Open menu"
         >
           <Menu size={26} />
         </button>

And for the close button (Line 98):

-          <button onClick={() => setOpen(false)} className="text-white">
+          <button onClick={() => setOpen(false)} className="text-white" aria-label="Close menu">
             <X size={24} />
           </button>

104-104: Hardcoded 50vh in calc will drift from the SHEET_HEIGHT constant.

Line 104 uses h-[calc(50vh-64px)] while the sheet height is controlled by the SHEET_HEIGHT constant on Line 13. If SHEET_HEIGHT changes, this calc won't update, causing layout overflow or wasted space.

Consider using an inline style for consistency:

Proposed fix
-         <div className="h-[calc(50vh-64px)] overflow-y-auto px-6 py-6 space-y-8 text-white">
+         <div className="overflow-y-auto px-6 py-6 space-y-8 text-white" style={{ height: `calc(${SHEET_HEIGHT} - 4rem)` }}>

89-147: Consider adding keyboard dismiss and focus management for the menu sheet.

The half-screen sheet behaves like a modal overlay but:

  1. Pressing Escape doesn't close it.
  2. Focus is not trapped — keyboard users can tab to elements behind the backdrop.

A minimal improvement would be adding an Escape key handler:

Proposed fix for Escape key
+  /* Close sheet on Escape */
+  useEffect(() => {
+    if (!open) return;
+    const onKey = (e: KeyboardEvent) => {
+      if (e.key === "Escape") setOpen(false);
+    };
+    window.addEventListener("keydown", onKey);
+    return () => window.removeEventListener("keydown", onKey);
+  }, [open]);

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.

Improper layering and backdrop handling in hamburger menu component

1 participant