Squashed commits (#1203)
- fix(browser-pane): ensure tooltip reliably triggers on container hover Co-authored-by: Orca <help@stably.ai>
This commit is contained in:
@@ -25,6 +25,7 @@ import {
|
||||
DropdownMenuShortcut,
|
||||
DropdownMenuTrigger
|
||||
} from '@/components/ui/dropdown-menu'
|
||||
import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip'
|
||||
import { useAppStore } from '@/store'
|
||||
import { ORCA_BROWSER_BLANK_URL, ORCA_BROWSER_PARTITION } from '../../../../shared/constants'
|
||||
import type {
|
||||
@@ -1785,16 +1786,28 @@ function BrowserPagePane({
|
||||
inputRef={addressBarInputRef}
|
||||
/>
|
||||
|
||||
<Button
|
||||
size="icon"
|
||||
variant={grab.state !== 'idle' ? 'default' : 'ghost'}
|
||||
className={`h-8 w-8 ${grab.state !== 'idle' ? 'bg-foreground/80 text-background hover:bg-foreground/90' : ''}`}
|
||||
onClick={grab.toggle}
|
||||
title={`Grab page element (${navigator.userAgent.includes('Mac') ? '⌘C' : 'Ctrl+C'})`}
|
||||
disabled={isBlankTab}
|
||||
>
|
||||
<Crosshair className="size-4" />
|
||||
</Button>
|
||||
<Tooltip>
|
||||
<TooltipTrigger asChild>
|
||||
{/* Why: wrap the disabled button in a span so pointer events still
|
||||
reach the tooltip trigger — Radix (and the DOM) drop hover
|
||||
events on disabled <button>, which is why the previous native
|
||||
`title` attribute fired inconsistently. */}
|
||||
<span className="inline-flex">
|
||||
<Button
|
||||
size="icon"
|
||||
variant={grab.state !== 'idle' ? 'default' : 'ghost'}
|
||||
className={`h-8 w-8 ${grab.state !== 'idle' ? 'bg-foreground/80 text-background hover:bg-foreground/90' : ''}`}
|
||||
onClick={grab.toggle}
|
||||
disabled={isBlankTab}
|
||||
>
|
||||
<Crosshair className="size-4" />
|
||||
</Button>
|
||||
</span>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent side="bottom" sideOffset={4}>
|
||||
{`Grab page element (${navigator.userAgent.includes('Mac') ? '⌘C' : 'Ctrl+C'})`}
|
||||
</TooltipContent>
|
||||
</Tooltip>
|
||||
|
||||
<Button
|
||||
size="icon"
|
||||
|
||||
Reference in New Issue
Block a user