OpenCRE icon indicating copy to clipboard operation
OpenCRE copied to clipboard

fix: improve mobile hamburger menu behavior

Open Abhijeet2409 opened this issue 8 months ago β€’ 1 comments

Summary

This PR improves the mobile hamburger menu behavior and usability. The issue was previously addressed in PR #654, but that PR was closed due to inactivity. This PR resolves the issue with a simplified implementation.

Changes

  • Fixed the mobile menu height so it no longer occupies unnecessary space.
  • Added a close (X) button to the mobile hamburger menu for better usability.

Testing

Before Fix

Before Fix

After Fix

After Fix

Closes #646

Abhijeet2409 avatar Mar 06 '26 19:03 Abhijeet2409

Review Change Stack

No actionable comments were generated in the recent review. πŸŽ‰

ℹ️ Recent review info
βš™οΈ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: 5a2c3f04-b97c-412a-b0c0-fbe24f2472ba

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between c0e28ddce9acb2df9dc3d13582fd50c08570e249 and 49f9bf6909cccb6eac438d935c5eef4348d8c02c.

πŸ“’ Files selected for processing (2)
  • application/frontend/src/scaffolding/Header/Header.tsx
  • application/frontend/src/scaffolding/Header/header.scss
🚧 Files skipped from review as they are similar to previous changes (2)
  • application/frontend/src/scaffolding/Header/Header.tsx
  • application/frontend/src/scaffolding/Header/header.scss

Summary by CodeRabbit

  • New Features

    • Added a dedicated mobile menu close button with a clear β€œX” icon and an accessible β€œClose menu” label, positioned at the top-right for faster dismissal.
  • Bug Fixes

    • Improved the mobile menu container sizing so it adapts to the actual content height instead of consistently filling the entire screen.

Walkthrough

Adds a close button to the mobile navigation menu. The X icon is imported from lucide-react, a button element wired to closeMobileMenu is inserted into the mobile menu container, and a new .mobile-menu-close CSS rule positions it absolutely in the top-right corner. The .navbar__mobile-menu height is changed from 100% to fit-content.

Changes

Mobile Menu Close Button

Layer / File(s) Summary
Close button markup and styles
application/frontend/src/scaffolding/Header/Header.tsx, application/frontend/src/scaffolding/Header/header.scss
X icon added to lucide-react import; a mobile-menu-close button calling closeMobileMenu is inserted into the mobile menu JSX with a screen-reader-only "Close menu" label; .mobile-menu-close is styled as absolute-positioned in the top-right corner with white text color and high z-index; .navbar__mobile-menu height changed from 100% to fit-content.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

πŸš₯ Pre-merge checks | βœ… 5
βœ… Passed checks (5 passed)
Check name Status Explanation
Title check βœ… Passed The title 'fix: improve mobile hamburger menu behavior' directly summarizes the main change, addressing the core improvement to mobile menu usability.
Description check βœ… Passed The description clearly outlines the changes made (fixed menu height and added close button), references the resolved issue (#646), and includes before/after testing screenshots.
Linked Issues check βœ… Passed The PR directly addresses all coding requirements from issue #646: adding a close button to the mobile menu and fixing the menu height to prevent full-screen occupation.
Out of Scope Changes check βœ… Passed All changes (X icon import, close button implementation, menu height adjustment, and button styling) are directly scoped to fixing mobile menu behavior as required by issue #646.
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.

coderabbitai[bot] avatar Jun 14 '26 10:06 coderabbitai[bot]

Merged via rebased #1027 β€” main already had the close button; kept the height: fit-content mobile menu fix.

northdpole avatar Aug 19 '26 14:08 northdpole