fix(chat): keep the latest reply mounted through settlement and animate the timeline collapse
The streaming and settled versions of the trailing assistant reply were two components, so settling unmounted one and mounted the other and the entrance tween replayed over text the reader was already on. One LatestAssistantEntry now owns that row under a single key, and the history list excludes it. The CSS entrance keyframe that doubled the GSAP tween is gone and the tween matches the documented 160ms. The step timeline no longer remounts on settle: it is a button-controlled disclosure with a 180ms grid-rows transition, the reader's own toggle wins over the live default, and an in-flight request with no events yet shows a queued row instead of an empty shell. BUG-474 BUG-475 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JUei7K13cYxLHE3Axe4A45
This commit is contained in:
co-authored by
Claude Fable 5.1
parent
6eadb62eb7
commit
be5e810ac9
@@ -4,15 +4,15 @@ import { renderToString } from "react-dom/server";
|
||||
import test from "node:test";
|
||||
|
||||
import {
|
||||
LatestAssistantEntry,
|
||||
SettledMessageList,
|
||||
StreamingMessageEntry,
|
||||
UnsplitChatTranscript,
|
||||
type ChatTranscriptActions,
|
||||
type ChatTranscriptProps,
|
||||
} from "../src/components/chat-transcript.tsx";
|
||||
import type { ChatMessage } from "../src/lib/chat-message-view.ts";
|
||||
import { createStreamFrameBuffer, type StreamFrameScheduler } from "../src/lib/stream-frame-buffer.ts";
|
||||
import { streamingChatMessageView } from "../src/lib/chat-message-view.ts";
|
||||
import { settledChatMessageViews, streamingChatMessageView } from "../src/lib/chat-message-view.ts";
|
||||
import {
|
||||
disableHomeStreamingRenderProbe,
|
||||
enableHomeStreamingRenderProbe,
|
||||
@@ -58,7 +58,14 @@ test("the split architecture renders settled history once while streaming tokens
|
||||
for (const streamingText of tokens) {
|
||||
const streamingMessage = streamingChatMessageView(messages, true, streamingText);
|
||||
assert.ok(streamingMessage);
|
||||
renderToString(createElement(StreamingMessageEntry, { message: streamingMessage }));
|
||||
renderToString(createElement(LatestAssistantEntry, {
|
||||
...base,
|
||||
loading: true,
|
||||
message: streamingMessage,
|
||||
views: [...settledChatMessageViews(messages), streamingMessage],
|
||||
index: messages.length,
|
||||
cancellationPending: false,
|
||||
}));
|
||||
}
|
||||
const split = homeStreamingRenderProbeSnapshot();
|
||||
disableHomeStreamingRenderProbe();
|
||||
@@ -103,7 +110,13 @@ test("frame coalescing renders the streaming row once per frame, not once per to
|
||||
flush: (frame) => {
|
||||
const streamingMessage = streamingChatMessageView(messages, true, frame.answer);
|
||||
assert.ok(streamingMessage);
|
||||
renderToString(createElement(StreamingMessageEntry, { message: streamingMessage }));
|
||||
renderToString(createElement(LatestAssistantEntry, {
|
||||
...propsFor(messages),
|
||||
loading: true,
|
||||
message: streamingMessage,
|
||||
views: [...settledChatMessageViews(messages), streamingMessage],
|
||||
index: messages.length,
|
||||
}));
|
||||
},
|
||||
});
|
||||
// 200 one-character tokens arrive four per frame across fifty frames.
|
||||
|
||||
Reference in New Issue
Block a user