Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions webview-ui/src/components/chat/ChatView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -434,9 +434,12 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
}, [messages.length])

useEffect(() => {
// Reset UI states
setExpandedRows({})
everVisibleMessagesTsRef.current.clear() // Clear for new task
setCurrentFollowUpTs(null) // Clear follow-up answered state for new task
setIsCondensing(false) // Reset condensing state when switching tasks
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good fix! The placement here with other UI state resets is logical and maintains consistency. However, would you consider adding a test case to verify that is properly reset when switching tasks? This would help prevent regression of this bug in the future.

You could add a test in one of the existing ChatView test files that:

  1. Sets up a task with set to true
  2. Switches to a different task
  3. Verifies that is reset to false

// Note: sendingDisabled is not reset here as it's managed by message effects

// Clear any pending auto-approval timeout from previous task
if (autoApproveTimeoutRef.current) {
Expand Down
Loading