From 6a29a8bd9985cfec3e8871159539a306a1851306 Mon Sep 17 00:00:00 2001 From: EMSHVAC Date: Thu, 20 Feb 2025 18:56:05 -0600 Subject: [PATCH] Prevents accidental task deletions by requiring explicit user confirmation through a modal dialog. This improves the user experience by adding a safety check before performing irreversible actions. --- src/core/webview/ClineProvider.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/core/webview/ClineProvider.ts b/src/core/webview/ClineProvider.ts index 05faa13834..6e6ba17db5 100644 --- a/src/core/webview/ClineProvider.ts +++ b/src/core/webview/ClineProvider.ts @@ -2309,6 +2309,17 @@ export class ClineProvider implements vscode.WebviewViewProvider { } async deleteTaskWithId(id: string) { + const answer = await vscode.window.showInformationMessage( + "Are you sure you want to delete this task? This action cannot be undone.", + { modal: true }, + "Delete", + "Cancel", + ) + + if (answer !== "Delete") { + return + } + if (id === this.cline?.taskId) { await this.clearTask() }