Skip to content

enhance navbar#617

Merged
mehul-m-prajapati merged 3 commits into
GitMetricsLab:mainfrom
Luffy-456:enhance-navbar
May 31, 2026
Merged

enhance navbar#617
mehul-m-prajapati merged 3 commits into
GitMetricsLab:mainfrom
Luffy-456:enhance-navbar

Conversation

@Luffy-456
Copy link
Copy Markdown
Contributor

@Luffy-456 Luffy-456 commented May 30, 2026

Related Issue


Description

The current navbar is functional but lacks a modern and visually appealing design. The overall appearance feels basic and doesn't fully align with UI/UX standards used in modern web applications.

Changes Made:

  • Added animated sliding pill for desktop navigation hover states
  • Refactored nav links into a reusable navItems array
  • Added scroll detection for dynamic navbar glass effect
  • Applied backdrop blur and translucent background on scroll
  • Improved navbar visual polish in both light and dark modes
  • Fixed mobile theme toggle icon visibility
  • Added custom opening animation for mobile menu

How Has This Been Tested?

  • Verified navbar rendering in both light and dark modes
  • Tested hover animations for all desktop navigation items
  • Verified scroll-based blur and transparency effects
  • Tested mobile menu open/close behavior
  • Confirmed theme toggle functionality on desktop and mobile devices

Screenshots (if applicable)

2026-05-30.13-30-07.mp4

Type of Change

  • Bug fix
  • New feature
  • Code style update
  • Breaking change
  • Documentation update

Summary by CodeRabbit

  • New Features

    • Navbar styling now adapts based on scroll position, transitioning from plain to translucent appearance
    • Added sliding indicator that highlights active navigation links
  • Style

    • Mobile menu displays with fade-in animation effect
  • Chores

    • Improved navigation structure using data-driven approach

- Added animated sliding pill for desktop navigation hover states
- Refactored nav links into a reusable navItems array
- Added scroll detection for dynamic navbar glass effect
- Applied backdrop blur and translucent background on scroll
- Improved navbar visual polish in both light and dark modes
- Fixed mobile theme toggle icon visibility
- Added custom opening animation for mobile menu
@netlify
Copy link
Copy Markdown

netlify Bot commented May 30, 2026

Deploy Preview for github-spy failed.

Name Link
🔨 Latest commit 320ad56
🔍 Latest deploy log https://app.netlify.com/projects/github-spy/deploys/6a1c104b3827f40008ede495

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 30, 2026

Review Change Stack

Warning

Review limit reached

@mehul-m-prajapati, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 31 minutes and 51 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, 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 include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0ded32a3-c88d-4835-989e-baf0f3b58899

📥 Commits

Reviewing files that changed from the base of the PR and between 4f7538f and 320ad56.

📒 Files selected for processing (2)
  • src/components/Navbar.tsx
  • src/index.css
📝 Walkthrough

Walkthrough

Navbar refactor centralizes navItems, adds scroll-driven translucent header, implements a desktop sliding-pill hover indicator positioned via DOM measurements, and rebuilds the mobile menu to render from navItems with a fade-in animation; supporting CSS utilities were added.

Changes

Navbar modernization with scroll tracking, sliding pill, and mobile menu improvements

Layer / File(s) Summary
Navbar foundation: state, hooks, and navigation data
src/components/Navbar.tsx
Introduces navItems; adds isOpen, pillStyle, and scrolled state; adds scroll listener to toggle nav styling; implements ref-based hover handlers to compute pill position/size; centralizes desktop link class into navLinkClass.
Desktop navigation with sliding pill indicator
src/components/Navbar.tsx
Replaces hardcoded desktop links with navItems.map() and NavLink components; adds a desktop-only sliding pill <span> positioned/sized from pillStyle; hides pill on mouse leave.
Mobile theme toggle Moon icon styling
src/components/Navbar.tsx
Updates mobile theme-toggle button markup and Moon icon color class when mode is not dark; toggleTheme remains wired as before.
Mobile menu rendering and fade-in animation
src/components/Navbar.tsx, src/index.css
Mobile menu renders NavLink entries from navItems, each link closes the menu on click; mobile menu container gains ani-fade-in class. src/index.css adds @keyframes fade-in and .ani-fade-in utility.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

gssoc25, type:bug

Poem

🐰 A frolicsome nav beneath the sun and moon,
Pills slide like rabbits under flowers in June,
Mobile menus softly fade into view,
Scroll brings a shimmer — translucent and new,
Hops of delight for code and crew!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title "enhance navbar" is vague and generic, using non-descriptive language that doesn't convey specific details about the modernization work completed. Use a more specific title such as "Add sliding pill animation and glass effect to navbar" or "Modernize navbar with animations and scroll effects" to better reflect the key improvements.
✅ Passed checks (4 passed)
Check name Status Explanation
Description check ✅ Passed The description fully addresses the template structure with all required sections completed: Related Issue, detailed Description with specific changes, comprehensive testing coverage, and Type of Change selections.
Linked Issues check ✅ Passed The PR successfully implements the modernization objective from issue #353 by adding visual enhancements, animations, and contemporary design patterns that align with modern UI/UX standards.
Out of Scope Changes check ✅ Passed All changes are directly aligned with the navbar modernization goals: the sliding pill, scroll detection, glass effect, refactored navItems, and mobile animations address the core objective without extraneous 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

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
Contributor

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

🧹 Nitpick comments (2)
src/index.css (2)

94-104: ⚡ Quick win

Prefer transform/opacity-only animation to avoid expensive blur repainting.

Animating filter: blur() here can introduce visible jank on low-end/mobile devices. Keep the effect to opacity + transform for smoother menu open.

Proposed change
 `@layer` utilities{
   `@keyframes` fade-in{
     from {
       opacity:0; 
       transform: translateY(20px); 
-      filter:blur(45px);
     }
     to{
       opacity:1;
       transform: translateY(0); 
-      filter:blur(0);
     }
   }
   .ani-fade-in{
     animation: fade-in 0.8s ease-out both;
   }
 }

Also applies to: 106-108

🤖 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 `@src/index.css` around lines 94 - 104, The keyframes animation "fade-in" (and
the similar block at lines 106-108) currently animates filter: blur(), which is
expensive; remove the filter property from both from/to blocks and only animate
opacity and transform (translateY) so the menu opens smoothly on low-end devices
— update the `@keyframes` fade-in and the other keyframe to drop filter: blur(…)
entries and ensure only opacity and transform are animated.

93-109: ⚡ Quick win

Add reduced-motion fallback for the mobile menu animation.

There’s no prefers-reduced-motion handling, so motion-sensitive users still get the transition. Add an opt-out utility override.

Proposed change
 `@layer` utilities{
   `@keyframes` fade-in{
@@
   .ani-fade-in{
     animation: fade-in 0.8s ease-out both;
   }
+
+  `@media` (prefers-reduced-motion: reduce) {
+    .ani-fade-in {
+      animation: none;
+    }
+  }
 }
🤖 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 `@src/index.css` around lines 93 - 109, Add a prefers-reduced-motion fallback
so users who opt out of motion aren't animated: wrap an `@media`
(prefers-reduced-motion: reduce) rule that targets the fade-in keyframes and the
.ani-fade-in utility (the `@keyframes` fade-in and the .ani-fade-in class) and
override the animation to none (and set static properties like opacity:1 and
transform:none if needed) so the mobile menu appears instantly for
reduced-motion users.
🤖 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 `@src/components/Navbar.tsx`:
- Around line 22-29: The useEffect adds a scroll listener but never initializes
scrolled, so call the handler once on mount and add the listener as passive;
specifically, inside the useEffect where handleScroll(), setScrolled, and
window.addEventListener("scroll", handleScroll) are used, invoke handleScroll()
immediately after defining it and change the addEventListener call to use {
passive: true } so the navbar state is correct on initial render and the scroll
listener is passive.

---

Nitpick comments:
In `@src/index.css`:
- Around line 94-104: The keyframes animation "fade-in" (and the similar block
at lines 106-108) currently animates filter: blur(), which is expensive; remove
the filter property from both from/to blocks and only animate opacity and
transform (translateY) so the menu opens smoothly on low-end devices — update
the `@keyframes` fade-in and the other keyframe to drop filter: blur(…) entries
and ensure only opacity and transform are animated.
- Around line 93-109: Add a prefers-reduced-motion fallback so users who opt out
of motion aren't animated: wrap an `@media` (prefers-reduced-motion: reduce) rule
that targets the fade-in keyframes and the .ani-fade-in utility (the `@keyframes`
fade-in and the .ani-fade-in class) and override the animation to none (and set
static properties like opacity:1 and transform:none if needed) so the mobile
menu appears instantly for reduced-motion users.
🪄 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: e65b63c3-d933-4ca8-ab1a-6fd01978b39f

📥 Commits

Reviewing files that changed from the base of the PR and between e7b8fc8 and 932da92.

📒 Files selected for processing (2)
  • src/components/Navbar.tsx
  • src/index.css

Comment thread src/components/Navbar.tsx
@Luffy-456
Copy link
Copy Markdown
Contributor Author

@itsdakshjain please review this PR

Copy link
Copy Markdown

@itsdakshjain itsdakshjain left a comment

Choose a reason for hiding this comment

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

hi @Luffy-456 thanks for the contribution, new effect on the navbar looks good

as you can see from the bot comment below, there is just one tiny bug we need to fix in Navbar.tsx before merging. right now, the scroll styling only applies in when a user actively moves the screen. if someone reloads the page while they are already sitting halfway down, the navbar won't style correctly until they start scrolling again.

let's fix that by running the handleScroll() function once right when the component mounts:

useEffect(() => {
  const handleScroll = () => {
    setScrolled(window.scrollY > 20);
  };
  
  handleScroll(); // checks scroll position immediately on load
  window.addEventListener("scroll", handleScroll, { passive: true });
  return () => window.removeEventListener("scroll", handleScroll);
}, []);

note for maintainers: the assigned labels are correct as per gssoc guidelines. also, please add the mentor label mentor:itsdakshjain to this pr.
@mehul-m-prajapati
once that quick change is pushed
ready to merge

fixed where scrolled starts as false if user refreshes while already scrolled down.

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@Luffy-456
Copy link
Copy Markdown
Contributor Author

@mehul-m-prajapati
Hello i have applied all the necessary changes and there are no merge conflicts according to me
and i also request @itsdakshjain to re-review the PR for any issues
after that this PR is ready to be merged

@mehul-m-prajapati mehul-m-prajapati merged commit 9c8f6af into GitMetricsLab:main May 31, 2026
1 of 6 checks passed
@github-actions
Copy link
Copy Markdown

🎉🎉 Thank you for your contribution! Your PR #617 has been merged! 🎉🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[UI/UX] Transform Navbar to modern design

3 participants