fix(web): tune agent infotip offset

This commit is contained in:
yyh 2026-06-25 13:48:18 +08:00
parent 349a2b9e71
commit 5713307f7b
No known key found for this signature in database
2 changed files with 6 additions and 0 deletions

View File

@ -36,6 +36,8 @@ type InfotipProps = {
'aria-label': string
/** Placement of the popup relative to the trigger. Defaults to `top`. */
'placement'?: Placement
/** Distance between the trigger and popup. Defaults to the popover primitive spacing. */
'sideOffset'?: number
/** Extra classes on the outer trigger wrapper (layout / margin). */
'className'?: string
/** Extra classes on the `?` icon itself (size / color overrides). */
@ -52,6 +54,7 @@ export function Infotip({
children,
'aria-label': ariaLabel,
placement = 'top',
sideOffset,
className,
iconClassName,
popupClassName,
@ -79,6 +82,7 @@ export function Infotip({
</PopoverTrigger>
<PopoverContent
placement={placement}
sideOffset={sideOffset}
popupClassName={cn('max-w-[300px] rounded-md px-3 py-2 system-xs-regular text-text-tertiary', popupClassName)}
>
{children}

View File

@ -81,6 +81,8 @@ export function AgentPreviewHeader({
</SegmentedControl>
<Infotip
aria-label={modeTip}
placement="bottom"
sideOffset={2}
className="size-5 rounded-md"
iconClassName="size-4 text-text-tertiary"
popupClassName="w-60 max-w-60 rounded-xl bg-components-tooltip-bg px-4 py-3.5 text-start text-text-secondary backdrop-blur-[5px]"