fix(ui): reasoning display glitches and scroll button persistence (#1206)
This commit is contained in:
parent
a1844c8294
commit
b229241854
3 changed files with 46 additions and 37 deletions
|
|
@ -1,5 +1,6 @@
|
|||
'use client';
|
||||
|
||||
import { useState, useEffect } from 'react';
|
||||
import {
|
||||
Reasoning,
|
||||
ReasoningTrigger,
|
||||
|
|
@ -15,10 +16,18 @@ export function MessageReasoning({
|
|||
isLoading,
|
||||
reasoning,
|
||||
}: MessageReasoningProps) {
|
||||
const [hasBeenStreaming, setHasBeenStreaming] = useState(isLoading);
|
||||
|
||||
useEffect(() => {
|
||||
if (isLoading) {
|
||||
setHasBeenStreaming(true);
|
||||
}
|
||||
}, [isLoading]);
|
||||
|
||||
return (
|
||||
<Reasoning
|
||||
isStreaming={isLoading}
|
||||
defaultOpen={true}
|
||||
defaultOpen={hasBeenStreaming}
|
||||
data-testid="message-reasoning"
|
||||
>
|
||||
<ReasoningTrigger />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue