diff --git a/web-app/src/containers/ThinkingBlock.tsx b/web-app/src/containers/ThinkingBlock.tsx index ed3e0e328..63f72fa44 100644 --- a/web-app/src/containers/ThinkingBlock.tsx +++ b/web-app/src/containers/ThinkingBlock.tsx @@ -107,27 +107,14 @@ const ThinkingBlock = ({ // Determine if the block is truly empty (streaming started but no content/steps yet) const isStreamingEmpty = loading && N === 0 - // If loading started but no content or steps have arrived yet, display the non-expandable 'Thinking...' block - if (isStreamingEmpty) { - return ( -
-
- - - {t('chat:thinking')} - -
-
- ) - } - // If not loading, and there are no steps, hide the block entirely. const hasContent = steps.length > 0 if (!loading && !hasContent) return null const handleClick = () => { // Only allow toggling expansion if not currently loading - if (!loading) { + // Also only allow if there is content (to prevent collapsing the simple 'Thinking') + if (!loading && hasContent) { setThinkingState(id, !isExpanded) } } @@ -265,7 +252,7 @@ const ThinkingBlock = ({ } } - // Fallback if loading but no activeStep (isStreamingEmpty case, though handled before this memo) + // Fallback for isStreamingEmpty state (N=0) return `${t('chat:thinking')}` } @@ -289,8 +276,9 @@ const ThinkingBlock = ({ return (
@@ -299,11 +287,12 @@ const ThinkingBlock = ({ )}
+ {isStreamingEmpty && ( +
+ + {t('chat:thinking')} + +
+ )} + {/* Streaming/Condensed View - shows active step (N-1) */} {loading && activeStep && (
{steps.map((step, index) => (