fix: canvas toolbar toggles getting stuck open on rapid hover#679
fix: canvas toolbar toggles getting stuck open on rapid hover#679breaking-brake merged 1 commit intomainbreaking-brake/cc-wf-studio:mainfrom fix/toolbar-toggle-stuck-openbreaking-brake/cc-wf-studio:fix/toolbar-toggle-stuck-openCopy head branch name to clipboard
Conversation
- Add useStableHover hook with document-level pointermove detection - Detect cursor outside element bounds even when mouseleave fails - Handle transitionend to catch stationary cursor during CSS transitions - Apply to all 5 canvas toolbar toggles Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughIntroduced a new Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested labels
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
## [3.30.3](v3.30.2...v3.30.3) (2026-03-23) ### Bug Fixes * canvas toolbar toggles getting stuck open on rapid hover ([#679](#679)) ([7b42494](7b42494)) ### Improvements * add minimap 3-state display mode with scroll auto-show ([#677](#677)) ([fb26d73](fb26d73)) * add PulseMCP discovery link to MCP server selection ([#674](#674)) ([e6f2b6c](e6f2b6c)) * add SkillsMP discovery link to Skill Browser dialog ([#675](#675)) ([7638fdf](7638fdf)) * add sub-agent discovery link to Sub-Agent Creation dialog ([#676](#676)) ([3523da8](3523da8)) * increase max node limit to 100 with user-configurable setting ([#678](#678)) ([e4318db](e4318db))
|
🎉 This PR is included in version 3.30.3 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Problem
Canvas toolbar toggles (ScrollMode, InteractionMode, EdgeAnimation, Highlight, Minimap) use a hover-expand UX where the toggle expands from a compact 28px icon to a full 100px control on hover. When rapidly moving the mouse in and out, the CSS width transition (200ms) causes the element boundary to shift under the cursor, preventing the browser from firing
mouseleave. This leavesisHoveredstuck astrue, keeping the toggle permanently expanded.Current Behavior
mouseleavenever firesExpected Behavior
Solution
Introduced
useStableHoverhook that does not rely solely onmouseleave. Instead, it attaches a document-levelpointermovelistener while hovered and hit-tests the cursor against the element's current bounding rect. If the cursor is outside (with a 4px margin), it forcesisHovered=false. It also listens fortransitionendto catch the case where the cursor is stationary while the element shrinks away.Changes
New file:
src/webview/src/hooks/useStableHover.tspointermovelistener (only active while hovered)transitionendlistener for stationary cursor during CSS transitionsModified files: All 5 canvas toolbar toggles
ScrollModeToggle.tsxInteractionModeToggle.tsxEdgeAnimationToggle.tsxHighlightToggle.tsxMinimapToggle.tsxuseState(false)withuseStableHover()hookrefto hoverable div for bounds checkingImpact
mouseleavestill works as fast path)Testing
npm run format && npm run lint && npm run build)🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Refactor