From 74c5f77bcbc04302bcba8bcbf585b0bb6d9ad152 Mon Sep 17 00:00:00 2001 From: Roo Code Date: Wed, 16 Jul 2025 07:54:25 +0000 Subject: [PATCH] fix: Update webview state after clearing completed right-click tasks Fixes issue #5772 where clicking the plus button after completing right-click context menu tasks (like "Explain Code" or "Improve Code") would incorrectly show the previous completed task interface instead of the new task interface on the first attempt. The issue was in the clearTask() method in ClineProvider.ts which only called removeClineFromStack() but did not update the webview state. This caused the UI to continue showing the old task interface because the webview was not notified that the task had been cleared. The fix adds await this.postStateToWebview() to the clearTask() method to ensure the UI is properly updated when a task is cleared, which resolves the issue where users had to click the plus button twice to get the new task interface. --- src/core/webview/ClineProvider.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/core/webview/ClineProvider.ts b/src/core/webview/ClineProvider.ts index 107122dcb46..470ea56a6a4 100644 --- a/src/core/webview/ClineProvider.ts +++ b/src/core/webview/ClineProvider.ts @@ -238,6 +238,7 @@ export class ClineProvider // This is used when the user cancels a task that is not a subtask async clearTask() { await this.removeClineFromStack() + await this.postStateToWebview() } /*