Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 40 additions & 38 deletions locales/ca/README.md

Large diffs are not rendered by default.

78 changes: 40 additions & 38 deletions locales/de/README.md

Large diffs are not rendered by default.

78 changes: 40 additions & 38 deletions locales/es/README.md

Large diffs are not rendered by default.

78 changes: 40 additions & 38 deletions locales/fr/README.md

Large diffs are not rendered by default.

78 changes: 40 additions & 38 deletions locales/hi/README.md

Large diffs are not rendered by default.

78 changes: 40 additions & 38 deletions locales/id/README.md

Large diffs are not rendered by default.

78 changes: 40 additions & 38 deletions locales/it/README.md

Large diffs are not rendered by default.

78 changes: 40 additions & 38 deletions locales/ja/README.md

Large diffs are not rendered by default.

78 changes: 40 additions & 38 deletions locales/ko/README.md

Large diffs are not rendered by default.

78 changes: 40 additions & 38 deletions locales/nl/README.md

Large diffs are not rendered by default.

78 changes: 40 additions & 38 deletions locales/pl/README.md

Large diffs are not rendered by default.

78 changes: 40 additions & 38 deletions locales/pt-BR/README.md

Large diffs are not rendered by default.

78 changes: 40 additions & 38 deletions locales/ru/README.md

Large diffs are not rendered by default.

78 changes: 40 additions & 38 deletions locales/tr/README.md

Large diffs are not rendered by default.

78 changes: 40 additions & 38 deletions locales/vi/README.md

Large diffs are not rendered by default.

78 changes: 40 additions & 38 deletions locales/zh-CN/README.md

Large diffs are not rendered by default.

78 changes: 40 additions & 38 deletions locales/zh-TW/README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion src/core/webview/ClineProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1166,7 +1166,12 @@ export class ClineProvider
await this.initClineWithHistoryItem(historyItem) // Clears existing task.
}

await this.postMessageToWebview({ type: "action", action: "chatButtonClicked" })
// Combine both actions into a single message to avoid race condition
await this.postMessageToWebview({
type: "action",
action: "chatButtonClicked",
followUpAction: "focusInput",
})
}

async exportTaskWithId(id: string) {
Expand Down
8 changes: 7 additions & 1 deletion src/core/webview/webviewMessageHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,8 @@ export const webviewMessageHandler = async (
// agentically running promises in old instance don't affect our new
// task. This essentially creates a fresh slate for the new task.
await provider.initClineWithTask(message.text, message.images)
// Focus the input after creating a new task
await provider.postMessageToWebview({ type: "action", action: "focusInput" })
break
case "customInstructions":
await provider.updateCustomInstructions(message.text)
Expand Down Expand Up @@ -432,7 +434,11 @@ export const webviewMessageHandler = async (
}
break
case "showTaskWithId":
provider.showTaskWithId(message.text!)
await provider.showTaskWithId(message.text!)
// Handle any follow-up action if specified
if (message.followUpAction) {
await provider.postMessageToWebview({ type: "action", action: message.followUpAction })
}
break
case "condenseTaskContextRequest":
provider.condenseTaskContext(message.text!)
Expand Down
2 changes: 2 additions & 0 deletions src/shared/ExtensionMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ export interface ExtensionMessage {
| "didBecomeVisible"
| "focusInput"
| "switchTab"
| string // Allow any string for flexibility
followUpAction?: string // For follow-up actions after main message handling
invoke?: "newChat" | "sendMessage" | "primaryButtonClick" | "secondaryButtonClick" | "setChatBoxMessage"
state?: ExtensionState
images?: string[]
Expand Down
1 change: 1 addition & 0 deletions src/shared/WebviewMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ export interface WebviewMessage {
visibility?: ShareVisibility // For share visibility
hasContent?: boolean // For checkRulesDirectoryResult
checkOnly?: boolean // For deleteCustomMode check
followUpAction?: string // For follow-up actions after main message handling
codeIndexSettings?: {
// Global state settings
codebaseIndexEnabled: boolean
Expand Down
6 changes: 5 additions & 1 deletion webview-ui/src/components/chat/ChatView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,11 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
}
}, [])

const startNewTask = useCallback(() => vscode.postMessage({ type: "clearTask" }), [])
const startNewTask = useCallback(() => {
vscode.postMessage({ type: "clearTask" })
// Focus the textarea directly after starting a new task
textAreaRef.current?.focus()
}, [])

// This logic depends on the useEffect[messages] above to set clineAsk,
// after which buttons are shown and we then send an askResponse to the
Expand Down