Skip to content

Commit 15b0f50

Browse files
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 <[email protected]>
1 parent cb0a58e commit 15b0f50

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/activate/registerCommands.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ const getCommandsMap = ({ context, outputChannel, provider }: RegisterCommandOpt
9797
await visibleProvider.removeClineFromStack()
9898
await visibleProvider.postStateToWebview()
9999
await visibleProvider.postMessageToWebview({ type: "action", action: "chatButtonClicked" })
100+
// Send focusInput action immediately after chatButtonClicked
101+
// This ensures the focus happens after the view has switched
102+
await visibleProvider.postMessageToWebview({ type: "action", action: "focusInput" })
100103
},
101104
mcpButtonClicked: () => {
102105
const visibleProvider = getVisibleProviderOrLog(outputChannel)

0 commit comments

Comments
 (0)