Add logic for handling different ask states in the webview

This commit is contained in:
Saoud Rizwan
2024-07-09 17:03:24 -04:00
parent caca0ca606
commit 6f5b0565e0
4 changed files with 120 additions and 51 deletions

View File

@@ -196,7 +196,7 @@ export class SidebarProvider implements vscode.WebviewViewProvider {
case "askResponse":
this.claudeDev?.handleWebviewAskResponse(message.askResponse!, message.text)
break
case "abortTask":
case "clearTask":
await this.clearTask()
await this.postStateToWebview()
break

View File

@@ -1,7 +1,7 @@
export interface WebviewMessage {
type: "apiKey" | "maxRequestsPerTask" | "webviewDidLaunch" | "newTask" | "askResponse" | "abortTask"
type: "apiKey" | "maxRequestsPerTask" | "webviewDidLaunch" | "newTask" | "askResponse" | "clearTask"
text?: string
askResponse?: ClaudeAskResponse
}
export type ClaudeAskResponse = "newTaskButtonTapped" | "yesButtonTapped" | "noButtonTapped" | "textResponse"
export type ClaudeAskResponse = "yesButtonTapped" | "noButtonTapped" | "textResponse"