import { useState } from "react"; import { ChevronDown, ChevronUp, X } from "lucide-react"; import { useSessionStore } from "../store/sessionStore"; import { Button } from "../components/ui/button"; const TAIL_LINES = 5; /** Left drawer showing "what's happening": the tail of the model's streamed output. * Collapsed it shows the last few lines (refreshing as the stream grows); the expand * toggle reveals the full stream. Opened on demand from the rotating activity icon. */ export function ModelActivityPanel({ onClose }: { onClose: () => void }) { const transcript = useSessionStore((s) => s.transcript); const [expanded, setExpanded] = useState(false); const lines = transcript .map((e) => e.text) .join("\n") .split("\n") .map((l) => l.trimEnd()) .filter((l) => l.trim() !== ""); const shown = expanded ? lines : lines.slice(-TAIL_LINES); const canExpand = lines.length > TAIL_LINES; return ( ); }