Fix compact hover using shared overlay policy - #3335
Merged
ymichael merged 7 commits intoSep 11, 2026
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The new early-return path can leave previously scheduled open/close timeouts uncleared when switching into compact viewport, allowing delayed transitions to fire after hover is disabled.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR fixes a UI flicker on compact viewports by disabling hover-driven popover open/close when the shared Popover renders as a responsive bottom drawer, while keeping explicit open/close behavior and preserving hover behavior on wider viewports.
Changes:
- Treat compact viewports as non-hoverable in
useHoverPopover(in addition to coarse pointers). - Add regression tests to confirm compact hover suppression and desktop hover behavior.
File summaries
| File | Description |
|---|---|
| apps/app/src/components/ui/hooks/use-hover-popover.ts | Disables hover-driven behavior in compact viewports by introducing an isPointerHoverDisabled condition. |
| apps/app/src/components/ui/hooks/use-hover-popover.test.tsx | Adds focused tests covering compact hover suppression, explicit open, and non-compact hover open. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Human comments
What was wrong
Compact Popovers render as bottom drawers, but the hover controller only disabled hover for coarse pointers. A mouse in a narrow window could open the drawer, lose the trigger's hover state when the drawer covered it, and close/reopen it. A reduced fixture reproduced repeated transitions during a bounded observation; indefinite oscillation in the full app was not established.
What changed
The shared responsive overlay module now owns both presentation (drawer or floating) and whether that presentation supports hover. The renderer and hover controller consume this same policy, so the hover controller no longer recreates viewport/pointer checks. Pending hover timers are cleared before yielding control to drawer behavior. Compact layouts use explicit click/tap or keyboard activation; wide fine-pointer hover is preserved.
The final diff contains two production files and their regenerated component-registry entry (+21/−9 lines). No new test file is included. There are no server/daemon wire, CLI, or public Plugin SDK changes, so no daemon protocol bump is needed.
How you verified
pnpm exec turbo run test --filter=@bb/app -- src/components/ui/responsive-overlay.test.tsx src/views/thread-detail/PaneMaximizeButton.test.tsx: 35 existing tests passed.pnpm exec turbo run build typecheck lint --filter=@bb/app --filter=@bb/shared-ui: passed, including after integrating current main.pnpm exec turbo run typecheck test --filter=@bb/plugin-registry: passed after regenerating the shared overlay registry entry, including the test that vendors and builds every registry component.git diff --check: passed. The generated registry matches its generator's canonical output (the existing registry JSON format differs from oxfmt).pnpm start:worktreeapp: compact hover remains closed, explicit opening shows stable context details, and wide hover still opens/closes normally. Checked the 767/768px boundary, compact fine/coarse pointer Enter/Space activation, Escape dismissal, focus return, and non-inert app root.Fixes #3334