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.

This commit is contained in:
EMSHVAC 2025-02-20 18:56:05 -06:00
parent de1519ad39
commit 6a29a8bd99

View file

@ -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()
}