mirror of
https://github.com/pacnpal/Roo-Code.git
synced 2025-12-20 20:31:37 -05:00
Focus textarea when webview becomes visible; add getApiMetrics
This commit is contained in:
@@ -41,6 +41,17 @@ export class SidebarProvider implements vscode.WebviewViewProvider {
|
||||
// and executes code based on the message that is recieved
|
||||
this.setWebviewMessageListener(webviewView.webview)
|
||||
|
||||
// Listen for when the panel becomes visible
|
||||
// https://github.com/microsoft/vscode-discussions/discussions/840
|
||||
webviewView.onDidChangeVisibility((e: any) => {
|
||||
if (e.visible) {
|
||||
// Your view is visible
|
||||
this.postMessageToWebview({ type: "action", action: "didBecomeVisible"})
|
||||
} else {
|
||||
// Your view is hidden
|
||||
}
|
||||
})
|
||||
|
||||
// if the extension is starting a new session, clear previous task state
|
||||
this.resetTask()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user