Skip to content

fix(dashboard): fix sidebar nav hover highlight snap-back#3092

Merged
alx-xo merged 3 commits into
mainfrom
alexm/fix-sidebar-nav-hover-CQQq
May 28, 2026
Merged

fix(dashboard): fix sidebar nav hover highlight snap-back#3092
alx-xo merged 3 commits into
mainfrom
alexm/fix-sidebar-nav-hover-CQQq

Conversation

@alx-xo
Copy link
Copy Markdown
Contributor

@alx-xo alx-xo commented May 28, 2026

Summary

This fixes some slight bugs with how the hover slider was behaving. Main one was it would snap back to the the last place if you hovered too long and then went to the next item. The other minor one was if you moved too fast it wouldn't register and the slider would never move


  • Moved setHoveredItem(null) from individual item onMouseLeave to the container div's onMouseLeave — highlight now stays on the last-hovered item while moving between items, and only returns to the active route when the mouse leaves the sidebar entirely
  • Reduced settle poll interval from 100ms → 50ms for snappier response
  • Fixed edge zone deadlock: CENTER_ZONE was blocking the settle trigger even when the mouse was fully stopped at the edge of an item — now bypassed when dy === 0

Root cause

Each nav item's onMouseLeave called setHoveredItem(null) immediately, snapping the sliding highlight back to the active route before the next item could settle. Because the settle interval takes up to 100ms to fire, this created a visible snap-to-active → slide-to-new-item sequence on every transition. Separately, the CENTER_ZONE edge exclusion had no escape hatch for a stopped mouse, causing the highlight to never trigger when the mouse landed precisely at the top or bottom of an item.

Test plan

  • Hover between nav items — highlight slides smoothly without snapping back to active route
  • Move mouse quickly to a nav item and stop — highlight triggers within ~50ms regardless of where in the item the mouse lands (top, center, bottom)
  • Move mouse off the sidebar entirely — highlight returns to active route
  • Fast drive-by movements across items don't trigger the highlight

Summary by cubic

Fixes sidebar nav hover highlight snap-back and makes hover intent more responsive. The highlight now stays on the last hovered item and only resets when the cursor leaves the sidebar; settling is faster and reliable at item edges.

  • Bug Fixes
    • Moved clearing of hoveredItem to the container onMouseLeave.
    • Reduced settle interval from 100ms to 50ms for quicker hover detection.
    • Skipped edge exclusion when the mouse is stopped (dy === 0) to prevent edge deadlocks.

Written for commit 73745be. Summary will update on new commits.

Review in cubic

alx-xo and others added 2 commits May 28, 2026 14:05
… leave

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…detection

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@alx-xo alx-xo requested review from a team as code owners May 28, 2026 21:21
Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

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

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.

Tip: disable this comment in your organization's Code Review settings.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 28, 2026

🦋 Changeset detected

Latest commit: 499efec

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
dashboard Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link
Copy Markdown

vercel Bot commented May 28, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
gram-docs-redirect Ready Ready Preview, Comment May 28, 2026 9:23pm

Request Review

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 1 file

Re-trigger cubic

@alx-xo alx-xo added this pull request to the merge queue May 28, 2026
Merged via the queue into main with commit 649a7cb May 28, 2026
39 checks passed
@alx-xo alx-xo deleted the alexm/fix-sidebar-nav-hover-CQQq branch May 28, 2026 22:10
@github-actions github-actions Bot locked and limited conversation to collaborators May 28, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants