Feature/debounce#588
Conversation
❌ Deploy Preview for github-spy failed.
|
|
Warning Review limit reached
More reviews will be available in 2 minutes and 29 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 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 configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
✨ 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 |
PR Title
Enhance navigation UX with smooth scrolling and active section highlighting
Summary
Closes: #511
Implements smooth scrolling across the site and improves navigation UX by dynamically highlighting active sections. Updates the Navbar, Hero, and Home components to support hash‑based navigation and IntersectionObserver tracking.
Changes (key files)
Frontend:
index.css: Added html { scroll-behavior: smooth; } for global smooth scrolling.
Navbar.tsx:
Replaced static NavLink layout with a navItems mapping.
Added hash links (/#features, /#how-it-works).
Switched to Link for routing.
Implemented IntersectionObserver to track and highlight the active homepage section.
Unified desktop + mobile link rendering.
Hero.tsx: Added “Explore Features” CTA linking to /#features.
Home.tsx: Added useLocation + useEffect to listen for location.hash changes and scroll the matching section into view (smooth scroll fallback for React Router).
Why
Improves navigation experience by enabling smooth scrolling.
Provides clear visual feedback by highlighting the active section in the Navbar.
Unifies desktop and mobile navigation behavior.
Makes homepage CTAs more interactive and user‑friendly.
How to test (local)
Run npm run build → project should compile successfully.
Start dev server → npm run dev.
Navigate to homepage:
Click “Features” or “How It Works” in Navbar → route hash updates and page scrolls smoothly to section.
Scroll manually → Navbar highlights the active section.
Click “Explore Features” CTA in Hero → smooth scroll to Features section.
Acceptance criteria mapped
Smooth scrolling enabled site‑wide.
Navbar highlights active section while scrolling.
Desktop and mobile navigation unified.
CTA links correctly scroll to target sections.
Build passes without errors (npm run build).
Notes
IntersectionObserver ensures efficient section tracking without performance issues.
Smooth scroll fallback implemented for React Router hash changes.
No breaking changes introduced; existing routes remain functional.