feat(webui): show when the agent picks up queued messages (#6719)

This commit is contained in:
chengyongru authored and GitHub committed 2026-11-19 16:03:16 +08:00
1 parent 3025a01cf0
commit b453de9cf6
26 files changed
+642 -29

No files matched your search

+6 -1
View File
@@ -2,6 +2,7 @@ import { useState, type ReactNode } from "react";
import { FileText, ImageIcon, Video } from "lucide-react";
import { useTranslation } from "react-i18next";
import { PendingEdgeOverlay, type PendingEdgeState } from "@/components/PendingEdgeOverlay";
import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover";
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip";
import type { UIMediaKind } from "@/lib/types";
@@ -10,12 +11,14 @@ import { cn } from "@/lib/utils";
export const attachmentCardActionClassName = "absolute right-0 top-0 grid h-11 w-11 place-items-center rounded-full focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring";
/** The card owns only its information surface; callers own removal, download, and status. */
export function AttachmentCard({ name, description, children, action, invalid = false }: {
export function AttachmentCard({ name, description, children, action, invalid = false, edgeState = "solid", onSealEnd }: {
name: string;
description?: string;
children: ReactNode;
action?: ReactNode;
invalid?: boolean;
edgeState?: PendingEdgeState;
onSealEnd?: () => void;
}) {
const [detailsOpen, setDetailsOpen] = useState(false);
const [hintOpen, setHintOpen] = useState(false);
@@ -28,7 +31,9 @@ export function AttachmentCard({ name, description, children, action, invalid =
return <span className={cn(
"relative block h-24 w-24 max-w-full shrink-0 rounded-control border transition-colors motion-reduce:transition-none",
invalid ? "border-destructive/40 bg-destructive/5 text-destructive" : "border-border/70 bg-muted/35",
edgeState !== "solid" && "border-transparent",
)}>
<PendingEdgeOverlay state={edgeState} solidTone="card" inset="-inset-px" onSealEnd={onSealEnd} />
<TooltipProvider>
<Tooltip open={hintOpen && !detailsOpen} onOpenChange={setHintOpen}>
<Popover open={detailsOpen} onOpenChange={changeDetailsOpen}>