Fix compact hover popover flicker - #3335
Open
dillonzq wants to merge 2 commits into
Open
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
On compact viewports, the shared
Popoverrenders content as a bottom drawer.useHoverPopoverdisabled hover only for coarse pointers, so a fine pointer in a narrow browser window could still open the drawer from the context-window indicator. Opening the drawer moved the pointer out of the trigger, which closed the popover; pointer re-entry opened it again and caused visible flicker. This addresses #3334.What changed
useHoverPopovernow treats compact viewports as non-hoverable, alongside coarse-pointer devices. It still allows explicit open/close changes and preserves hover behavior on wider viewports.How you verified
../../node_modules/.bin/vitest run --config vitest.config.ts src/components/ui/hooks/use-hover-popover.test.tsx src/views/thread-detail/PaneMaximizeButton.test.tsx— 2 files, 15 tests passed.git diff --check— passed.Operation not permitted); the direct Vitest run completed successfully.Fixes #3334