diff --git a/apps/desktop/src/components/ui/tooltip.tsx b/apps/desktop/src/components/ui/tooltip.tsx index fc84933294c..c482cefdc1c 100644 --- a/apps/desktop/src/components/ui/tooltip.tsx +++ b/apps/desktop/src/components/ui/tooltip.tsx @@ -5,6 +5,11 @@ import { useI18n } from '@/i18n' import { useKeybindHint } from '@/lib/keybinds/use-keybind-hint' import { cn } from '@/lib/utils' +/** Default hover-open delay for `Tip`. Non-zero so a cursor sweeping across the + * chrome doesn't flash a trail of tips — they only appear on a deliberate, + * settled hover. Call sites that need an instant tip pass `delayDuration={0}`. */ +const TIP_DELAY_MS = 200 + /** True inside `RootTooltipProvider`. `Tip` uses this to decide whether it * needs to supply its own provider — see the note on `Tip`. */ const HasTooltipProvider = React.createContext(false) @@ -79,7 +84,8 @@ function TooltipContent({ // Transparent, width-capped wrapper. The visible chip is the inner inline // span so `box-decoration-break: clone` gives a marker-style background // that hugs EACH wrapped line (bg only on the text, ragged right — no - // rectangular dead space). Instant, no transition (delayDuration=0). + // rectangular dead space). No fade transition — once the hover delay + // elapses the chip appears at once. // pointer-events-none: the tip must never steal hover/clicks from the // chrome underneath (titlebar tools, adjacent tabs, etc.). className={cn('pointer-events-none z-(--z-over-modal) w-fit max-w-64 select-none', className)} @@ -127,7 +133,7 @@ interface TipProps extends Omit