feat: focus chat input when clicking plus button in extension menu (#6689)

* feat: focus chat input when clicking plus button in extension menu

- Added focusInput action after chatButtonClicked in plusButtonClicked handler
- This ensures the text area in ChatView gets focused when users click the + button
- Improves user experience by allowing immediate typing after creating new chat

* fix: replace unreliable setTimeout with sequential message passing

- Removed setTimeout with hardcoded 100ms delay
- Now sending focusInput action immediately after chatButtonClicked
- This ensures proper sequencing without arbitrary timing delays
- More reliable approach that doesn't depend on timing assumptions

---------

Co-authored-by: Roo Code <roomote@roocode.com>
This commit is contained in:
roomote[bot] 2025-08-07 09:33:25 -04:00 committed by GitHub
parent cb0a58e4a4
commit 15b0f50dd9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -97,6 +97,9 @@ const getCommandsMap = ({ context, outputChannel, provider }: RegisterCommandOpt
await visibleProvider.removeClineFromStack()
await visibleProvider.postStateToWebview()
await visibleProvider.postMessageToWebview({ type: "action", action: "chatButtonClicked" })
// Send focusInput action immediately after chatButtonClicked
// This ensures the focus happens after the view has switched
await visibleProvider.postMessageToWebview({ type: "action", action: "focusInput" })
},
mcpButtonClicked: () => {
const visibleProvider = getVisibleProviderOrLog(outputChannel)