Skip to content

fix: use Popover for context indicator on mobile viewports#23747

Merged
kylecarbs merged 1 commit intomainfrom
fix/mobile-context-tooltip-popover
Mar 28, 2026
Merged

fix: use Popover for context indicator on mobile viewports#23747
kylecarbs merged 1 commit intomainfrom
fix/mobile-context-tooltip-popover

Conversation

@kylecarbs
Copy link
Copy Markdown
Member

Problem

The context-usage indicator ring in the agents chat uses a Radix UI Tooltip, which only opens on hover. On mobile/touch devices there is no hover event, so tapping the indicator does nothing.

Fix

On mobile viewports (< 640 px, matching the existing isMobileViewport() helper), render a Popover instead of a Tooltip so that tapping the ring toggles the context-usage info. Desktop behavior (hover tooltip) is unchanged.

  • Extract the trigger button and content into shared variables to avoid duplication
  • Conditionally render Popover (mobile) or Tooltip (desktop) based on viewport width
  • Both Popover and PopoverContent were already imported in the file

Radix UI Tooltip only opens on hover, which does not exist on touch
devices. On mobile viewports (< 640 px), swap the Tooltip for a
Popover so tapping the context-usage ring toggles the info panel.

Desktop behavior (hover tooltip) is unchanged.
@kylecarbs kylecarbs merged commit a279956 into main Mar 28, 2026
29 checks passed
@kylecarbs kylecarbs deleted the fix/mobile-context-tooltip-popover branch March 28, 2026 16:26
@github-actions github-actions bot locked and limited conversation to collaborators Mar 28, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants