{items.map((item, i) => {
if (item.kind === "thought") {
- return ;
+ return ;
}
if (item.kind === "text") {
return ;
@@ -2898,86 +2898,3 @@ export function ChatPanel({
);
}
-function TimelineThought({ text }: { text: string }) {
- // Auto-expand if the thought is actively streaming (i.e., less than a full turn old)
- // but let the user collapse it. To keep it simple, we default to false (collapsed),
- // but if the component mounts and text is very short (just starting to stream), we could
- // expand it. A better UX is to collapse it by default but allow expanding.
- // However, you asked that the final message display before the final thinking hides the response.
- // Wait, the prompt: "most tools collapse the thinking text once the next action starts to make the chat less noisy. But also gives the user to the option to expand it."
-
- // We can track if we are the "latest" thought, but an easier way is to just use a ref
- // to see if we're actively receiving new props (streaming).
-
- const [expanded, setExpanded] = React.useState(true);
- const textLenRef = React.useRef(text.length);
-
- React.useEffect(() => {
- // If text stops growing for a bit, auto-collapse
- let t = setTimeout(() => {
- if (text.length === textLenRef.current) {
- setExpanded(false);
- }
- }, 1500);
- return () => clearTimeout(t);
- }, [text]);
-
- React.useEffect(() => {
- textLenRef.current = text.length;
- }, [text]);
-
- return (
-