|
|
@@ -8,6 +8,7 @@ import { Package } from "../shared/package"
|
|
|
import { getCommand } from "../utils/commands"
|
|
|
import { ClineProvider } from "../core/webview/ClineProvider"
|
|
|
import { ContextProxy } from "../core/config/ContextProxy"
|
|
|
+import { focusPanel } from "../utils/focusPanel"
|
|
|
|
|
|
import { registerHumanRelayCallback, unregisterHumanRelayCallback, handleHumanRelayResponse } from "./humanRelay"
|
|
|
import { handleNewTask } from "./handleTask"
|
|
|
@@ -172,20 +173,23 @@ const getCommandsMap = ({ context, outputChannel, provider }: RegisterCommandOpt
|
|
|
},
|
|
|
focusInput: async () => {
|
|
|
try {
|
|
|
- const panel = getPanel()
|
|
|
-
|
|
|
- if (!panel) {
|
|
|
- await vscode.commands.executeCommand(`workbench.view.extension.${Package.name}-ActivityBar`)
|
|
|
- } else if (panel === tabPanel) {
|
|
|
- panel.reveal(vscode.ViewColumn.Active, false)
|
|
|
- } else if (panel === sidebarPanel) {
|
|
|
- await vscode.commands.executeCommand(`${ClineProvider.sideBarId}.focus`)
|
|
|
+ await focusPanel(tabPanel, sidebarPanel)
|
|
|
+
|
|
|
+ // Send focus input message only for sidebar panels
|
|
|
+ if (sidebarPanel && getPanel() === sidebarPanel) {
|
|
|
provider.postMessageToWebview({ type: "action", action: "focusInput" })
|
|
|
}
|
|
|
} catch (error) {
|
|
|
outputChannel.appendLine(`Error focusing input: ${error}`)
|
|
|
}
|
|
|
},
|
|
|
+ focusPanel: async () => {
|
|
|
+ try {
|
|
|
+ await focusPanel(tabPanel, sidebarPanel)
|
|
|
+ } catch (error) {
|
|
|
+ outputChannel.appendLine(`Error focusing panel: ${error}`)
|
|
|
+ }
|
|
|
+ },
|
|
|
acceptInput: () => {
|
|
|
const visibleProvider = getVisibleProviderOrLog(outputChannel)
|
|
|
|