fix: keep streamed reasoning expanded

This commit is contained in:
lofyer
2026-08-12 23:10:25 +08:00
parent d769f31492
commit ca5b722571
3 changed files with 92 additions and 5 deletions
+5
View File
@@ -1399,6 +1399,11 @@ describe('App', () => {
(_, element) => element?.textContent === rawToolOutput
)
).toBeVisible()
const activeReasoning = screen.getAllByText('正在推理')
expect(activeReasoning).toHaveLength(2)
for (const reasoning of activeReasoning) {
expect(reasoning.closest('details')).toHaveAttribute('open')
}
act(() => {
if (!request) {
+1 -5
View File
@@ -5446,11 +5446,7 @@ function App(): React.JSX.Element {
<details
className="message-reasoning"
key={item.block.id}
open={
message.state === 'streaming' &&
message.blocks?.at(-1)?.id ===
item.block.id
}
open={message.state === 'streaming'}
>
<summary>
{message.state === 'streaming'