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:
Glen Maddern 2025-06-24 19:08:36 +10:00
commit 78e01032ae

View file

@ -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]);