/** * ChatPanel — read-only live transcript of one agent-to-agent conversation. * * Reveals messages one by one to mirror the backend's staged generation, * and auto-scrolls to the newest message. * * Architecture: rendered inside AgentWindow; fed the conversation object * and the revealed-count from the simulation snapshot. * * Design: observation-only — there is deliberately no input to talk to * agents from the UI. */ import { useEffect, useRef } from "react"; import ChatBubble from "./ChatBubble"; export default function ChatPanel({ conversation, selfId, color, revealedCount }) { const bottomRef = useRef(null); const messages = conversation?.messages || []; const visible = revealedCount != null ? messages.slice(0, revealedCount) : messages; useEffect(() => { bottomRef.current?.scrollIntoView({ behavior: "smooth" }); }, [visible.length]); if (!messages.length) return null; return (