Skip to content

Fix compact hover using shared overlay policy - #3335

Merged
ymichael merged 7 commits into
get-bb:mainfrom
dillonzq:fix/compact-hover-popover-flicker
Sep 11, 2026
Merged

Fix compact hover using shared overlay policy#3335
ymichael merged 7 commits into
get-bb:mainfrom
dillonzq:fix/compact-hover-popover-flicker

Conversation

@dillonzq

@dillonzq dillonzq commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

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

  • Reproduced independently on main before applying the fix.
  • 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.
  • Source formatting and git diff --check: passed. The generated registry matches its generator's canonical output (the existing registry JSON format differs from oxfmt).
  • Live Chromium verification against the optimized pnpm start:worktree app: 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.
  • iOS Simulator Safari loaded the fixture, but native interaction verification was blocked by the window-control tool; no native interaction pass is claimed.

Fixes #3334

AGENT GENERATED

Copilot AI lite review requested due to automatic review settings September 9, 2026 11:28

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 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.

Comment thread apps/app/src/components/ui/hooks/use-hover-popover.ts
@ymichael ymichael changed the title Fix compact hover popover flicker Fix compact hover using shared overlay policy Sep 11, 2026
@ymichael
ymichael merged commit f9a0ab0 into get-bb:main Sep 11, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Context-window usage indicator flickers when hovered on compact viewports

3 participants