🐛 fix(Playground): Fix reasoning panel auto-collapse behavior to allow user control
- Add `hasAutoCollapsed` flag to track auto-collapse state - Modify reasoning panel to auto-collapse only once after thinking completion - Allow users to manually toggle reasoning panel after auto-collapse - Update message creation, streaming updates, and completion handlers - Ensure consistent behavior across stream/non-stream requests and error cases Previously, the reasoning/thinking panel would auto-collapse every time the AI completed its thinking process, preventing users from reopening it to review the reasoning content. Now it auto-collapses only once when thinking is complete, then allows full user control. Files changed: - web/src/hooks/useApiRequest.js: Updated all message handling functions - web/src/utils/messageUtils.js: Added hasAutoCollapsed to initial state
This commit is contained in:
@@ -107,6 +107,7 @@ export const createLoadingAssistantMessage = () => createMessage(
|
||||
reasoningContent: '',
|
||||
isReasoningExpanded: true,
|
||||
isThinkingComplete: false,
|
||||
hasAutoCollapsed: false,
|
||||
status: 'loading'
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user