mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix(site): align streaming thinking spacing (#25291)
This commit is contained in:
@@ -268,13 +268,24 @@ export const ThinkingDuringStreamingWithToolCalls: Story = {
|
||||
tool_call_id: "tc-1",
|
||||
args: { command: "ls -la" },
|
||||
},
|
||||
{
|
||||
type: "tool-call",
|
||||
tool_name: "read_file",
|
||||
tool_call_id: "tc-2",
|
||||
args: { path: "README.md" },
|
||||
},
|
||||
]),
|
||||
},
|
||||
play: async ({ canvasElement }) => {
|
||||
const canvas = within(canvasElement);
|
||||
// "Thinking" should still be visible during streaming
|
||||
// when only tool-call blocks have arrived.
|
||||
// Tool-only stream chunks can otherwise clear the activity indicator before text arrives.
|
||||
const matches = canvas.getAllByText("Thinking");
|
||||
expect(matches.length).toBeGreaterThanOrEqual(1);
|
||||
|
||||
const thinkingBlock = matches[0].parentElement;
|
||||
expect(thinkingBlock).toBeInstanceOf(HTMLElement);
|
||||
expect(getComputedStyle(thinkingBlock as HTMLElement).marginTop).toBe(
|
||||
"8px",
|
||||
);
|
||||
},
|
||||
};
|
||||
|
||||
@@ -92,7 +92,7 @@ export const StreamingOutput: FC<{
|
||||
<ConversationItem {...conversationItemProps}>
|
||||
<Message className="w-full">
|
||||
<MessageContent className="whitespace-normal">
|
||||
<div className="space-y-3">
|
||||
<div className="space-y-2">
|
||||
{shouldShowBlocks && (
|
||||
<BlockList
|
||||
blocks={blocks}
|
||||
|
||||
Reference in New Issue
Block a user