MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / focusPanel

Function focusPanel

src/utils/focusPanel.ts:11–27  ·  view source on GitHub ↗
(
	tabPanel: vscode.WebviewPanel | undefined,
	sidebarPanel: vscode.WebviewView | undefined,
)

Source from the content-addressed store, hash-verified

9 * @returns Promise that resolves when focus is complete
10 */
11export async function focusPanel(
12 tabPanel: vscode.WebviewPanel | undefined,
13 sidebarPanel: vscode.WebviewView | undefined,
14): Promise<void> {
15 const panel = tabPanel || sidebarPanel
16
17 if (!panel) {
18 // If no panel is open, open the sidebar
19 await vscode.commands.executeCommand(`workbench.view.extension.${Package.name}-ActivityBar`)
20 } else if (panel === tabPanel && !panel.active) {
21 // For tab panels, use reveal to focus
22 panel.reveal(vscode.ViewColumn.Active, false)
23 } else if (panel === sidebarPanel) {
24 // For sidebar panels, focus the sidebar
25 await vscode.commands.executeCommand(`${ClineProvider.sideBarId}.focus`)
26 }
27}

Callers 1

getCommandsMapFunction · 0.90

Calls 1

executeCommandMethod · 0.80

Tested by

no test coverage detected