refactor: soften chat composer hint

This commit is contained in:
lc6464 2026-06-11 22:56:21 +08:00 committed by Guoguo
parent 890f4d6bcb
commit dc746fbe66

View file

@ -10,11 +10,6 @@ import TextareaAutosize from "react-textarea-autosize"
import { ContextUsageRing } from "@/components/chat/context-usage-ring" import { ContextUsageRing } from "@/components/chat/context-usage-ring"
import { Button } from "@/components/ui/button" import { Button } from "@/components/ui/button"
import {
Tooltip,
TooltipContent,
TooltipTrigger,
} from "@/components/ui/tooltip"
import { cn } from "@/lib/utils" import { cn } from "@/lib/utils"
import type { ChatAttachment, ContextUsage } from "@/store/chat" import type { ChatAttachment, ContextUsage } from "@/store/chat"
@ -188,28 +183,18 @@ export function ChatComposer({
/> />
)} )}
{canInput ? ( {canInput ? (
<Tooltip delayDuration={700}> <span tabIndex={!canSend ? 0 : undefined}>
<TooltipTrigger asChild> <Button
<span tabIndex={!canSend ? 0 : undefined}> type="button"
<Button size="icon"
type="button" className="size-8 rounded-full bg-violet-500 text-white transition-transform hover:bg-violet-600 active:scale-95"
size="icon" onClick={onSend}
className="size-8 rounded-full bg-violet-500 text-white transition-transform hover:bg-violet-600 active:scale-95" disabled={!canSend}
onClick={onSend} aria-label={t("chat.sendMessage")}
disabled={!canSend}
aria-label={t("chat.sendMessage")}
>
<IconArrowUp className="size-4" />
</Button>
</span>
</TooltipTrigger>
<TooltipContent
className="border-border/70 bg-muted text-foreground border text-center whitespace-pre-line shadow-lg shadow-black/10 dark:shadow-black/30"
arrowClassName="bg-muted fill-muted"
> >
{t("chat.sendHint")} <IconArrowUp className="size-4" />
</TooltipContent> </Button>
</Tooltip> </span>
) : null} ) : null}
</div> </div>
</div> </div>
@ -218,7 +203,7 @@ export function ChatComposer({
<div <div
aria-hidden={!hasInput} aria-hidden={!hasInput}
className={cn( className={cn(
"border-border/70 bg-muted text-foreground mt-2 inline-flex items-center rounded-md border px-3 py-1.5 text-xs shadow-lg shadow-black/10 transition-all duration-200 dark:shadow-black/30", "border-border/50 bg-muted/55 text-muted-foreground mt-2 inline-flex items-center rounded-md border px-3 py-1 text-[11px] shadow-sm transition-all duration-200 dark:bg-muted/45",
hasInput hasInput
? "translate-y-0 opacity-100" ? "translate-y-0 opacity-100"
: "pointer-events-none -translate-y-1 opacity-0", : "pointer-events-none -translate-y-1 opacity-0",