fix: unify chat process and reply presentation

This commit is contained in:
2026-10-29 17:54:34 +08:00
parent 7621bf0f86
commit 9474788db6
46 changed files with 3160 additions and 500 deletions
@@ -0,0 +1,31 @@
import { CheckCircle2, LoaderCircle, XCircle } from "lucide-react";
import { StatusIcon, type StatusTone } from "@/shared/ui/status";
import type { AgentChatProgress } from "../types";
const states = {
completed: { label: "已完成", tone: "success", Icon: CheckCircle2 },
error: { label: "失败", tone: "danger", Icon: XCircle },
running: { label: "进行中", tone: "info", Icon: LoaderCircle }
} satisfies Record<
AgentChatProgress["status"],
{ label: string; tone: StatusTone; Icon: typeof CheckCircle2 }
>;
/** Ordinary steps and tool calls share the same status glyph, size and tone. */
export function AgentProgressStatusIcon({ status }: { status: AgentChatProgress["status"] }) {
const { label, tone, Icon } = states[status];
return (
<StatusIcon
data-progress-status={status}
role="img"
aria-label={label}
tone={tone}
activity={status === "running" ? "loading" : "static"}
shape="circle"
size="sm"
className="border-0"
>
<Icon className="size-3.5" aria-hidden="true" />
</StatusIcon>
);
}