diff --git a/apps/web/app/components/chain-of-thought.tsx b/apps/web/app/components/chain-of-thought.tsx index 51574114132..2a6b0919ec6 100644 --- a/apps/web/app/components/chain-of-thought.tsx +++ b/apps/web/app/components/chain-of-thought.tsx @@ -691,7 +691,7 @@ export function ChainOfThought({ parts, isStreaming }: { parts: ChainPart[]; isS className="flex items-start gap-2.5 py-1.5" >
- {anyRunning ? ( - - ) : ( + - )} +
- + {anyRunning ? `Fetching ${items.length} sources...` : `Fetched ${items.length} sources`} @@ -984,18 +976,10 @@ function MediaGroup({ return (
- {anyRunning ? ( - - ) : ( + - )} +
- + + +
)} {hasMore && ( @@ -1259,27 +1237,21 @@ function ToolStep({ return (
- {status === "running" ? ( - - ) : status === "error" ? ( + {status === "error" ? ( ) : ( - + + + )}
- {label} + {label} {/* Exit code badge for exec tools */} {kind === "exec" && status === "done" && output?.exitCode !== undefined && ( void; + onSendNow: (id: string) => void; + onRemove: (id: string) => void; +}) { + const [editing, setEditing] = useState(false); + const [draft, setDraft] = useState(msg.text); + const inputRef = useRef(null); + + const autoResize = () => { + const el = inputRef.current; + if (!el) {return;} + el.style.height = "auto"; + el.style.height = `${el.scrollHeight}px`; + }; + + useEffect(() => { + if (editing) { + inputRef.current?.focus(); + const len = inputRef.current?.value.length ?? 0; + inputRef.current?.setSelectionRange(len, len); + autoResize(); + } + }, [editing]); + + const commitEdit = () => { + const trimmed = draft.trim(); + if (trimmed && trimmed !== msg.text) { + onEdit(msg.id, trimmed); + } else { + setDraft(msg.text); + } + setEditing(false); + }; + + return ( +
0 ? "border-t" : ""}`} + style={idx > 0 ? { borderColor: "var(--color-border)" } : undefined} + > + + {idx + 1} + + {editing ? ( +