feat: add openClineSidebarPanel RPC and route VS Code focus via hostbridge (#5859)

This commit is contained in:
kvyb authored and GitHub committed 2025-08-28 19:38:19 +03:00
1 parent f526317796
commit fa4fa01ec3
4 files changed
+17 -3

No files matched your search

+7
View File
@@ -26,6 +26,9 @@ service WorkspaceService {
// Opens the IDE file explorer panel and selects a file or directory.
rpc openInFileExplorerPanel(OpenInFileExplorerPanelRequest) returns (OpenInFileExplorerPanelResponse);
// Opens and focuses the Cline sidebar panel in the host IDE.
rpc openClineSidebarPanel(OpenClineSidebarPanelRequest) returns (OpenClineSidebarPanelResponse);
}
message GetWorkspacePathsRequest {
@@ -86,3 +89,7 @@ message OpenInFileExplorerPanelRequest {
string path = 1;
}
message OpenInFileExplorerPanelResponse {}
// Request/response for opening the Cline sidebar
message OpenClineSidebarPanelRequest {}
message OpenClineSidebarPanelResponse {}
+1 -1
View File
@@ -75,7 +75,7 @@ async function showVersionUpdateAnnouncement(context: vscode.ExtensionContext) {
const message = previousVersion
? `Cline has been updated to v${currentVersion}`
: `Welcome to Cline v${currentVersion}`
await vscode.commands.executeCommand("claude-dev.SidebarProvider.focus")
await HostProvider.workspace.openClineSidebarPanel({})
await new Promise((resolve) => setTimeout(resolve, 200))
HostProvider.window.showMessage({
type: ShowMessageType.INFORMATION,
+2 -2
View File
@@ -443,8 +443,8 @@ export async function activate(context: vscode.ExtensionContext) {
if (tabInstances.length > 0) {
activeWebview = tabInstances[tabInstances.length - 1]
} else {
// Try to focus sidebar
await vscode.commands.executeCommand("claude-dev.SidebarProvider.focus")
// Try to focus sidebar via hostbridge
await HostProvider.workspace.openClineSidebarPanel({})
// Small delay for focus to complete
await new Promise((resolve) => setTimeout(resolve, 200))
@@ -0,0 +1,7 @@
import * as vscode from "vscode"
import { OpenClineSidebarPanelRequest, OpenClineSidebarPanelResponse } from "@/shared/proto/index.host"
export async function openClineSidebarPanel(_: OpenClineSidebarPanelRequest): Promise<OpenClineSidebarPanelResponse> {
await vscode.commands.executeCommand("claude-dev.SidebarProvider.focus")
return {}
}