mirror of
https://gitee.com/wanwujie/deer-flow
synced 2026-04-21 13:24:44 +08:00
feat: add realtime subagent status report
This commit is contained in:
@@ -17,13 +17,17 @@ import { Shimmer } from "@/components/ai-elements/shimmer";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { ShineBorder } from "@/components/ui/shine-border";
|
||||
import { useI18n } from "@/core/i18n/hooks";
|
||||
import { hasToolCalls } from "@/core/messages/utils";
|
||||
import {
|
||||
streamdownPlugins,
|
||||
streamdownPluginsWithWordAnimation,
|
||||
} from "@/core/streamdown";
|
||||
import { useSubtask } from "@/core/tasks/context";
|
||||
import { explainLastToolCall } from "@/core/tools/utils";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
import { FlipDisplay } from "../flip-display";
|
||||
|
||||
export function SubtaskCard({
|
||||
className,
|
||||
taskId,
|
||||
@@ -84,7 +88,16 @@ export function SubtaskCard({
|
||||
)}
|
||||
>
|
||||
{icon}
|
||||
{t.subtasks[task.status]}
|
||||
<FlipDisplay
|
||||
className="pb-1"
|
||||
uniqueKey={task.latestMessage?.id ?? ""}
|
||||
>
|
||||
{task.status === "in_progress" &&
|
||||
task.latestMessage &&
|
||||
hasToolCalls(task.latestMessage)
|
||||
? explainLastToolCall(task.latestMessage, t)
|
||||
: t.subtasks[task.status]}
|
||||
</FlipDisplay>
|
||||
</div>
|
||||
)}
|
||||
<ChevronUp
|
||||
@@ -107,6 +120,16 @@ export function SubtaskCard({
|
||||
}
|
||||
></ChainOfThoughtStep>
|
||||
)}
|
||||
{task.status === "in_progress" &&
|
||||
task.latestMessage &&
|
||||
hasToolCalls(task.latestMessage) && (
|
||||
<ChainOfThoughtStep
|
||||
label={t.subtasks.in_progress}
|
||||
icon={<Loader2Icon className="size-4 animate-spin" />}
|
||||
>
|
||||
{explainLastToolCall(task.latestMessage, t)}
|
||||
</ChainOfThoughtStep>
|
||||
)}
|
||||
{task.status === "completed" && (
|
||||
<>
|
||||
<ChainOfThoughtStep
|
||||
|
||||
Reference in New Issue
Block a user