fix: Remove delay for instant reasoning block collapse
- Remove 500ms setTimeout delay when reasoning finishes - Reasoning block now collapses immediately when response starts - Creates smoother transition from thinking to response phase - Eliminates jarring delay between reasoning end and collapse The reasoning block now collapses instantly as soon as the model starts generating the actual response, providing better UX flow.
This commit is contained in:
parent
b810f639aa
commit
78e01032ae
1 changed files with 2 additions and 6 deletions
|
|
@ -15,14 +15,10 @@ const ReasoningBlock: React.FC<ReasoningBlockProps> = ({
|
|||
}) => {
|
||||
const [isExpanded, setIsExpanded] = useState(isStreaming); // Start expanded when streaming
|
||||
|
||||
// Auto-collapse when streaming finishes
|
||||
// Auto-collapse instantly when streaming finishes
|
||||
useEffect(() => {
|
||||
if (!isStreaming && startTime && endTime) {
|
||||
// Add a small delay before collapsing so user can see completion
|
||||
const timer = setTimeout(() => {
|
||||
setIsExpanded(false);
|
||||
}, 500);
|
||||
return () => clearTimeout(timer);
|
||||
setIsExpanded(false);
|
||||
}
|
||||
}, [isStreaming, startTime, endTime]);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue