fix(webui): normalize action tooltips

This commit is contained in:
Xubin Ren 2026-06-10 04:10:24 +08:00
parent 1432094bb5
commit fd947a1fd8
2 changed files with 60 additions and 45 deletions

View File

@ -22,6 +22,12 @@ import { AttachmentTile } from "@/components/AttachmentTile";
import { CliAppMentionText } from "@/components/CliAppMentionText"; import { CliAppMentionText } from "@/components/CliAppMentionText";
import { ImageLightbox } from "@/components/ImageLightbox"; import { ImageLightbox } from "@/components/ImageLightbox";
import { MarkdownText, preloadMarkdownText } from "@/components/MarkdownText"; import { MarkdownText, preloadMarkdownText } from "@/components/MarkdownText";
import {
Tooltip,
TooltipContent,
TooltipProvider,
TooltipTrigger,
} from "@/components/ui/tooltip";
import { cn } from "@/lib/utils"; import { cn } from "@/lib/utils";
import { copyTextToClipboard } from "@/lib/clipboard"; import { copyTextToClipboard } from "@/lib/clipboard";
import { formatTurnLatency } from "@/lib/format"; import { formatTurnLatency } from "@/lib/format";
@ -187,13 +193,15 @@ export function MessageBubble({
</MarkdownText> </MarkdownText>
{media.length > 0 ? <MessageMedia media={media} align="left" /> : null} {media.length > 0 ? <MessageMedia media={media} align="left" /> : null}
{showAssistantFooterRow ? ( {showAssistantFooterRow ? (
<TooltipProvider delayDuration={220} skipDelayDuration={80}>
<div className="mt-2 flex min-h-8 flex-wrap items-center gap-x-2 gap-y-1 text-muted-foreground"> <div className="mt-2 flex min-h-8 flex-wrap items-center gap-x-2 gap-y-1 text-muted-foreground">
{showCopyButton ? ( {showCopyButton ? (
<Tooltip>
<TooltipTrigger asChild>
<button <button
type="button" type="button"
onClick={onCopyAssistantReply} onClick={onCopyAssistantReply}
aria-label={copyReplyLabel} aria-label={copyReplyLabel}
title={copyReplyLabel}
className={cn( className={cn(
"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full", "inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full",
"transition-colors hover:bg-muted/55 hover:text-foreground", "transition-colors hover:bg-muted/55 hover:text-foreground",
@ -206,13 +214,17 @@ export function MessageBubble({
<Copy className="h-4 w-4" aria-hidden /> <Copy className="h-4 w-4" aria-hidden />
)} )}
</button> </button>
</TooltipTrigger>
<TooltipContent side="top" align="center">{copyReplyLabel}</TooltipContent>
</Tooltip>
) : null} ) : null}
{showForkButton ? ( {showForkButton ? (
<Tooltip>
<TooltipTrigger asChild>
<button <button
type="button" type="button"
onClick={onForkFromHere} onClick={onForkFromHere}
aria-label={forkLabel} aria-label={forkLabel}
title={forkLabel}
className={cn( className={cn(
"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full", "inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full",
"transition-colors hover:bg-muted/55 hover:text-foreground", "transition-colors hover:bg-muted/55 hover:text-foreground",
@ -221,6 +233,9 @@ export function MessageBubble({
> >
<GitFork className="h-4 w-4" aria-hidden /> <GitFork className="h-4 w-4" aria-hidden />
</button> </button>
</TooltipTrigger>
<TooltipContent side="top" align="center">{forkLabel}</TooltipContent>
</Tooltip>
) : null} ) : null}
{showLatencyFooter ? ( {showLatencyFooter ? (
<span <span
@ -231,6 +246,7 @@ export function MessageBubble({
</span> </span>
) : null} ) : null}
</div> </div>
</TooltipProvider>
) : null} ) : null}
</> </>
)} )}

View File

@ -1768,7 +1768,6 @@ export function ThreadComposer({
disabled={voiceRecorder.buttonDisabled} disabled={voiceRecorder.buttonDisabled}
aria-label={voiceButtonLabel} aria-label={voiceButtonLabel}
aria-keyshortcuts={VOICE_SHORTCUT_ARIA} aria-keyshortcuts={VOICE_SHORTCUT_ARIA}
title={voiceButtonTooltip}
onPointerDown={voiceRecorder.beginPress} onPointerDown={voiceRecorder.beginPress}
onPointerUp={voiceRecorder.endPress} onPointerUp={voiceRecorder.endPress}
onPointerCancel={voiceRecorder.endPress} onPointerCancel={voiceRecorder.endPress}