/
outbreak
/
kilocode
Обзор
Документация
Войти
/
outbreak
/
kilocode
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/utils/focusPanel.ts
27 строк
992 B
Chris Hasson
Reapply "Always focus the panel when clicked to ensure menu buttons are visible" (#4598)
17 июн 2025, 23:51
Не верифицирован
17 июн 2025, 23:51
e484bff
Код
Авторство
О чём код?
import * as vscode from "vscode" import { Package } from "../shared/package" import { ClineProvider } from "../core/webview/ClineProvider" /** * Focus the active panel (either tab or sidebar) * @param tabPanel - The tab panel reference * @param sidebarPanel - The sidebar panel reference * @returns Promise that resolves when focus is complete */ export async function focusPanel( tabPanel: vscode.WebviewPanel | undefined, sidebarPanel: vscode.WebviewView | undefined, ): Promise<void> { const panel = tabPanel || sidebarPanel if (!panel) { // If no panel is open, open the sidebar await vscode.commands.executeCommand(`workbench.view.extension.${Package.name}-ActivityBar`) } else if (panel === tabPanel && !panel.active) { // For tab panels, use reveal to focus panel.reveal(vscode.ViewColumn.Active, false) } else if (panel === sidebarPanel) { // For sidebar panels, focus the sidebar await vscode.commands.executeCommand(`${ClineProvider.sideBarId}.focus`) } }