Previously the chat-controller created one AssistantMessageComponent per assistant message and removed/re-appended it to the chat container's tail on every tool block, forcing all narration after every tool execution regardless of stream order. Users had to scroll up to read text that was written before each tool call. Replace the reorder hack with a stream-order segment walker that walks content[] left-to-right, collapses contiguous text/thinking blocks into text-run segments, emits one segment per tool block, and append-only adds new segments to chatContainer. AssistantMessageComponent gains a ContentRange API so a single message can spawn multiple text-run components, plus a separate showMetadata flag so timestamp/error footers render only on the trailing segment without duplicating earlier text. Adds a regression test that streams [text, tool, text, tool, text] and asserts both interleaved order and per-segment rendered text content. Closes #4144 |
||
|---|---|---|
| .. | ||
| scripts | ||
| src | ||
| package.json | ||
| tsconfig.json | ||