fix(navbar): sync active section highlight with scroll position#81
Merged
Amansingh0807 merged 1 commit intoMar 1, 2026
Conversation
- Replace IntersectionObserver with scroll event listener - Ensure Home tab highlights by default on page load - Update navbar highlight dynamically as user scrolls through sections - Improve UX by matching visual indicator with actual page location
Contributor
|
@vedamehar is attempting to deploy a commit to the Aman Singh's projects Team on Vercel. A member of the Team first needs to authorize it. |
✅ PR Checklist CompleteGreat job @vedamehar! Your PR follows all the guidelines. A maintainer will review it soon. Thank you for your contribution! 🙏 |
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Amansingh0807
approved these changes
Mar 1, 2026
Amansingh0807
left a comment
Owner
There was a problem hiding this comment.
Everything looks good to me, Thanks for Contributing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixed the navbar active section highlighting issue where "Testimonial" was incorrectly shown as the active tab on page load instead of "Home". Implemented a scroll event listener that dynamically updates the navbar highlight as users navigate through different sections.
Changes Made:
Related Issue
Resolves #80
Type of Change
Performance Improvements
Checklist
AI Disclosure
AI Tool Used:
Testing
Test Configuration:
Manual Testing Results:
Screenshots
Before
The navbar showed "Testimonial" as highlighted by default on the home page instead of "Home".

After
The navbar now correctly shows "Home" as highlighted by default, and updates dynamically as the user scrolls through sections with improved performance.

Additional Notes
This fix improves both the user experience (visual indicator matches actual location) and performance (simpler scroll detection vs complex IntersectionObserver with aggressive margins). The implementation is more efficient and maintainable.
Note to Reviewers: All checklist items are completed. Performance improvements documented. AI assistance was used transparently. Code has been thoroughly tested locally.