fix(#562): add active state indicator to BottomNav#645
Merged
Hydrax117 merged 1 commit intoJun 30, 2026
Conversation
- Apply aria-current=page to active nav link - Add animated top-border pill using Framer Motion layoutId - Add background highlight pill on active item - Fix layoutId re-mount bug (conditional dot was unmounting on route change) - Respect prefers-reduced-motion: skip layout animation, use duration 0
|
@dark-sarge is attempting to deploy a commit to the paul joseph's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@dark-sarge Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
PR: Active State Indicator for BottomNav — Fix #562
Summary
Fixes #562. The
BottomNavcomponent previously rendered navigation icons with no visual distinction for the current route. Users had no way to tell which section they were in. This PR adds a clear active state with proper accessibility attributes and smooth animated indicators.Changes
File modified:
frontend/src/components/ui/BottomNav.tsxWhat changed
aria-current="page"— applied to the active<Link>so screen readers and assistive technologies correctly identify the current page within the navigation landmark.Top-border pill — a
bg-primarybar (h-0.5 w-8) is rendered at the top edge of the active item using Framer Motion'slayoutId="activeBar". This slides smoothly between items as the route changes without unmounting/remounting.Background highlight pill — a
bg-primary/10rounded rectangle fills the active item area usinglayoutId="activeBg", providing a tinted background behind the icon and label for clear visual grouping.Filled icon + primary text — the active icon receives
fill-primaryand the label receivestext-primary(retained from previous implementation, now working in conjunction with the new indicators).Reduced motion support — when
prefers-reduced-motionis set,layoutIdis set toundefinedso Framer Motion skips the shared-element animation. Transitions useduration: 0.Fixed
layoutIdre-mount bug — the old implementation conditionally rendered a dot inside each item, which caused the element to unmount and remount on every route change, defeating Framer Motion'slayoutIdshared-element tracking. The new approach renders indicators only on the active item with stablelayoutIdvalues so the animation correctly interpolates position between items.Route switching behaviour
usePathname()fromnext/navigationtriggers a re-render of only the nav component on route change — no full page re-render. ThelayoutIdmechanism animates the indicator's position via layout animation rather than opacity toggling.Acceptance Criteria
aria-current="page"usePathname()+ Framer MotionlayoutIdTesting
<a>element — it should havearia-current="page".prefers-reduced-motionin OS/browser settings and confirm indicators snap instantly with no animation.Notes
Leaderboarditem still uses theTrophyicon (same as Tournaments) — a separate icon swap can be tracked in a follow-up issue.