mirror of
https://github.com/pacnpal/Roo-Code.git
synced 2025-12-21 12:51:17 -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()
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
export interface ExtensionMessage {
|
||||
type: "action" | "state"
|
||||
text?: string
|
||||
action?: "plusButtonTapped" | "settingsButtonTapped"
|
||||
action?: "plusButtonTapped" | "settingsButtonTapped" | "didBecomeVisible"
|
||||
state?: { didOpenOnce: boolean, apiKey?: string, maxRequestsPerTask?: number, claudeMessages: ClaudeMessage[] }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user