diff --git a/frontend/components/chat/chat-panel.tsx b/frontend/components/chat/chat-panel.tsx index bd608d6..8c31d03 100644 --- a/frontend/components/chat/chat-panel.tsx +++ b/frontend/components/chat/chat-panel.tsx @@ -2,7 +2,7 @@ import { useChat } from "@ai-sdk/react"; import { DefaultChatTransport, type ToolUIPart } from "ai"; -import { AlertTriangle, ShieldCheck, X } from "lucide-react"; +import { AlertTriangle, Brain, ChevronDown, ShieldCheck, X } from "lucide-react"; import { nanoid } from "nanoid"; import { useSearchParams } from "next/navigation"; import { useCallback, useEffect, useMemo, useRef, useState } from "react"; @@ -33,11 +33,6 @@ import { QueueItemIndicator, QueueList, } from "@/components/ai-elements/queue"; -import { - Reasoning, - ReasoningContent, - ReasoningTrigger, -} from "@/components/ai-elements/reasoning"; import { Shimmer } from "@/components/ai-elements/shimmer"; import { Suggestion, Suggestions } from "@/components/ai-elements/suggestion"; import { @@ -59,6 +54,11 @@ import { } from "@/components/chat/record-list-card"; import { VeilConfirmation } from "@/components/chat/veil-confirmation"; import { Badge } from "@/components/ui/badge"; +import { + Collapsible, + CollapsibleContent, + CollapsibleTrigger, +} from "@/components/ui/collapsible"; import { DEFAULT_EFFORT, DEFAULT_MODEL_ID, @@ -351,14 +351,20 @@ export function ChatPanel() { const key = `${message.id}-${i}`; if (part.type === "reasoning") { return ( - - - {part.text} - + + + + {isWorking && isLast ? ( + {t("chat.reasoning")} + ) : ( + t("chat.reasoning") + )} + + + + {part.text} + + ); } if (part.type.startsWith("tool-")) { diff --git a/frontend/lib/i18n/locales/en/translation.json b/frontend/lib/i18n/locales/en/translation.json index 93541da..b7ba111 100644 --- a/frontend/lib/i18n/locales/en/translation.json +++ b/frontend/lib/i18n/locales/en/translation.json @@ -772,6 +772,7 @@ "patientNotFound": "I couldn't find a patient with file number {{fileNumber}}.", "thinking": "Thinking…", "steps": "Steps", + "reasoning": "Reasoning", "suggestions": { "schedule": "Show today's schedule", "tasks": "List open tasks",