Repository navigation
Description
Summary
On compact/mobile viewports, hovering the context-window usage indicator in the follow-up composer makes the popover flicker continuously. The popover opens as the shared responsive bottom drawer, the trigger then leaves the hover region, and the drawer closes and reopens as the pointer re-enters. The indicator should open once and remain stable; tapping or keyboard activation should continue to work.
Versions and environment
- bb 0.42.1, reproduced from source on
mainat commit682f0d2c5dc5bbe920d4a253f66a6c5cedcb955b - macOS 26.6.2
- Node.js v26.8.1
- Web UI reached through a bb Connect test instance; exact browser version was not collected
- Provider-independent composer UI behavior
- Investigation thread:
thr_79iew88x8f
Steps to reproduce
- Open a bb thread in a compact viewport, such as a phone-sized browser window.
- Expand the follow-up composer so the context-window usage indicator is visible in the footer.
- Hover the circular context-window indicator.
- Observe the responsive popover/drawer as it repeatedly opens and closes.
- Click or tap the indicator and compare the result with the hover behavior.
Expected vs actual
Expected: Hovering the indicator opens one stable context-window popover, or compact layouts ignore hover and require an explicit click/tap. The popover should not visibly reopen and close.
Actual: The popover opens as a bottom drawer, loses the trigger's hover state, closes, and immediately reopens. This produces visible flashing and makes the usage details difficult to read.
Evidence
The context-window indicator uses the shared hover-popover hook:
bb/apps/app/src/components/thread/timeline/ThreadContextWindowIndicator.tsx
Lines 23 to 31 in 682f0d2
| const { | |
| open: hoverOpen, | |
| triggerHoverProps, | |
| contentHoverProps, | |
| handleOpenChange, | |
| } = useHoverPopover({ | |
| closeDelayMs: CONTEXT_WINDOW_POPOVER_CLOSE_DELAY_MS, | |
| hoverableContent: false, | |
| }); |
The hook disables pointer hover only for coarse pointers, so a fine pointer in a compact viewport still attaches pointer enter/leave handlers and schedules open/close transitions:
bb/apps/app/src/components/ui/hooks/use-hover-popover.ts
Lines 50 to 117 in 682f0d2
| openDelayMs = DEFAULT_OPEN_DELAY_MS, | |
| closeDelayMs = DEFAULT_CLOSE_DELAY_MS, | |
| hoverableContent = true, | |
| }: UseHoverPopoverOptions = {}): UseHoverPopoverResult { | |
| const isPointerCoarse = usePointerCoarse(); | |
| const [open, setOpen] = useState(false); | |
| const [isFocusOverTrigger, setIsFocusOverTrigger] = useState(false); | |
| const [isFocusOverContent, setIsFocusOverContent] = useState(false); | |
| const [isPointerOverTrigger, setIsPointerOverTrigger] = useState(false); | |
| const [isPointerOverContent, setIsPointerOverContent] = useState(false); | |
| const toggleTimeoutRef = useRef<number | null>(null); | |
| const clearToggleTimeout = useCallback(() => { | |
| if (toggleTimeoutRef.current === null) { | |
| return; | |
| } | |
| window.clearTimeout(toggleTimeoutRef.current); | |
| toggleTimeoutRef.current = null; | |
| }, []); | |
| useEffect(() => { | |
| if (isPointerCoarse) return; | |
| clearToggleTimeout(); | |
| if (isFocusOverTrigger || isFocusOverContent) { | |
| if (!open) setOpen(true); | |
| return; | |
| } | |
| if (isPointerOverTrigger || isPointerOverContent) { | |
| if (open) return; | |
| if (openDelayMs <= 0) { | |
| setOpen(true); | |
| return; | |
| } | |
| toggleTimeoutRef.current = window.setTimeout(() => { | |
| setOpen(true); | |
| toggleTimeoutRef.current = null; | |
| }, openDelayMs); | |
| return clearToggleTimeout; | |
| } | |
| if (!open) return; | |
| toggleTimeoutRef.current = window.setTimeout(() => { | |
| setOpen(false); | |
| toggleTimeoutRef.current = null; | |
| }, closeDelayMs); | |
| return clearToggleTimeout; | |
| }, [ | |
| clearToggleTimeout, | |
| closeDelayMs, | |
| isFocusOverContent, | |
| isFocusOverTrigger, | |
| isPointerCoarse, | |
| isPointerOverContent, | |
| isPointerOverTrigger, | |
| open, | |
| openDelayMs, | |
| ]); | |
| useEffect(() => clearToggleTimeout, [clearToggleTimeout]); | |
The shared popover intentionally renders its content as a responsive drawer on compact viewports:
bb/packages/shared-ui/src/components/ui/popover.tsx
Lines 31 to 63 in 682f0d2
| function Popover({ | |
| children, | |
| open: controlledOpen, | |
| onOpenChange: controlledOnChange, | |
| defaultOpen, | |
| ...props | |
| }: React.ComponentProps<typeof PopoverPrimitive.Root>) { | |
| const ctx = useResponsiveRoot( | |
| controlledOpen, | |
| controlledOnChange, | |
| defaultOpen, | |
| ); | |
| if (ctx.isCompactViewport) { | |
| return ( | |
| <ResponsivePopoverContext.Provider value={ctx}> | |
| {children} | |
| </ResponsivePopoverContext.Provider> | |
| ); | |
| } | |
| return ( | |
| <PopoverPrimitive.Root | |
| open={ctx.open} | |
| onOpenChange={ctx.onOpenChange} | |
| {...props} | |
| > | |
| <ResponsivePopoverContext.Provider value={ctx}> | |
| {children} | |
| </ResponsivePopoverContext.Provider> | |
| </PopoverPrimitive.Root> | |
| ); | |
| } |
bb/packages/shared-ui/src/components/ui/popover.tsx
Lines 145 to 166 in 682f0d2
| if (isCompactViewport) { | |
| const domProps = stripRadixContentProps(props); | |
| return ( | |
| <ResponsiveDrawerShell | |
| open={open} | |
| onOpenChange={onOpenChange} | |
| srLabel={mobileTitle ?? "Options"} | |
| contentClassName={mobileClassName} | |
| onContentAnimationEnd={onMobileContentAnimationEnd} | |
| > | |
| <div | |
| ref={ref} | |
| className={cn( | |
| "overflow-y-auto px-4 pt-2 pb-[max(1rem,env(safe-area-inset-bottom))]", | |
| className, | |
| )} | |
| {...domProps} | |
| > | |
| {children} | |
| </div> | |
| </ResponsiveDrawerShell> |
The focused regression test added during the investigation reproduces the relevant pre-fix state transition and verifies that compact hover is disabled while explicit opening remains available.
What you ruled out
- The issue does not occur in the same hover-popover path on a wide desktop viewport.
- The behavior is provider-independent and comes from shared app UI.
- No matching open or closed issue was found for context-window indicator hover flicker after searching
hover flicker,popover mobile,context window, anddrawer popover. - Slash command suggestions are effectively unusable on mobile Chrome #3179 covers mobile slash-command menu sizing, and Narrow side-chat composer collapses when opening the model picker #2394 covers a narrow side-chat model-picker collapse; neither covers this hover/open-state loop.
Suggested priority and effort
Medium: the context details remain available through a click/tap, but the compact hover path visibly flashes and prevents reliable inspection. The smallest fix is to suppress pointer-hover open/close for compact viewports in the shared hover-popover hook while retaining focus and explicit activation, plus a regression test.
AGENT GENERATED
Activity
bb-slop-cop commentedon Sep 9, 2026
🚨 SLOP COP 🚨 ·
new-issue-autopilotApplied Bug · Medium priority · Low effort and
ui,mobile.Reproduction report: PARTIALLY REPRODUCED, high root-cause confidence; label
partial-repro.Fine-pointer hover remains enabled when compact popovers use a pointer-covering drawer. Two clean trusted checkouts produced
open → closed → openafter one hover, failing the stability assertion. Continuous flicker in the full app remains unverified; the report includes the component-fixture limits and test evidence.No duplicate PR: #3335 is already open and linked.
Fix compact hover using shared overlay policy (get-bb#3335)