Compare commits

...

8 Commits

Author SHA1 Message Date
frostbournesb 6ed3c380ab fix focusChatInput call after opening ext 2025-04-15 18:36:59 -07:00
frostbournesb f0566ab3cb Jump to chat input from anywhere 2025-04-15 17:21:59 -07:00
frostbournesb b7d2a19114 fix unit test 2025-04-15 15:25:01 -07:00
frostbournesb d527b3ef1b changeset 2025-04-15 15:24:49 -07:00
frostbournesb 7a5143f58c Merge remote-tracking branch 'origin/main' into frostbourne/eng-417 2025-04-15 14:59:45 -07:00
frostbournesb 37f931b3cd Allow cmd to focus from anywhere 2025-04-15 14:58:31 -07:00
frostbournesb f7dcab9756 Merge remote-tracking branch 'origin/main' into frostbourne/eng-417 2025-04-09 18:25:30 -07:00
frostbournesb dab49cd67e Make command to focus on chat input 2025-04-09 18:19:33 -07:00
8 changed files with 45 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
"claude-dev": patch
---
Add command to focus chat input
+5
View File
@@ -116,6 +116,11 @@
"command": "cline.fixWithCline",
"title": "Fix with Cline",
"category": "Cline"
},
{
"command": "cline.focusChatInput",
"title": "Jump to Chat Input",
"category": "Cline"
}
],
"keybindings": [
+1 -1
View File
@@ -4,7 +4,7 @@ import { ApiHandler } from "../"
import { ApiHandlerOptions, XAIModelId, ModelInfo, xaiDefaultModelId, xaiModels } from "../../shared/api"
import { convertToOpenAiMessages } from "../transform/openai-format"
import { ApiStream } from "../transform/stream"
import { ChatCompletionReasoningEffort } from "openai/resources/chat/completions.mjs"
import { ChatCompletionReasoningEffort } from "openai/resources/chat/completions"
export class XAIHandler implements ApiHandler {
private options: ApiHandlerOptions
+7
View File
@@ -254,6 +254,13 @@ export class Controller {
telemetryService.updateTelemetryState(isOptedIn)
})
break
case "showChatView": {
this.postMessageToWebview({
type: "action",
action: "chatButtonClicked",
})
break
}
case "newTask":
// Code that should run in response to the hello message command
//vscode.window.showInformationMessage(message.text!)
+18
View File
@@ -397,6 +397,24 @@ export function activate(context: vscode.ExtensionContext) {
}),
)
// Register the focusChatInput command handler
context.subscriptions.push(
vscode.commands.registerCommand("cline.focusChatInput", () => {
let visibleWebview = WebviewProvider.getVisibleInstance()
if (!visibleWebview) {
vscode.commands.executeCommand("claude-dev.SidebarProvider.focus")
visibleWebview = WebviewProvider.getSidebarInstance()
// showing the extension will call didBecomeVisible which focuses it already
// but it doesn't focus if a tab is selected which focusChatInput accounts for
}
visibleWebview?.controller.postMessageToWebview({
type: "action",
action: "focusChatInput",
})
}),
)
// Set up test server if in test mode
if (IS_TEST === "true") {
createTestServer(sidebarWebview)
+1
View File
@@ -60,6 +60,7 @@ export interface ExtensionMessage {
| "accountLoginClicked"
| "accountLogoutClicked"
| "accountButtonClicked"
| "focusChatInput"
invoke?: Invoke
state?: ExtensionState
images?: string[]
+1
View File
@@ -29,6 +29,7 @@ export interface WebviewMessage {
| "openFile"
| "openMention"
| "cancelTask"
| "showChatView"
| "refreshOpenRouterModels"
| "refreshRequestyModels"
| "refreshOpenAiModels"
@@ -461,6 +461,13 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
textAreaRef.current?.focus()
}
break
case "focusChatInput":
textAreaRef.current?.focus()
if (isHidden) {
// Send message back to extension to show chat view
vscode.postMessage({ type: "showChatView" })
}
break
}
break
case "selectedImages":