From 15b0f50dd93564e20c8ab687c81fb6fba791980e Mon Sep 17 00:00:00 2001 From: "roomote[bot]" <219738659+roomote[bot]@users.noreply.github.com> Date: Thu, 7 Aug 2025 09:33:25 -0400 Subject: [PATCH] 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 --- src/activate/registerCommands.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/activate/registerCommands.ts b/src/activate/registerCommands.ts index 2f8212ffa0..0534f24782 100644 --- a/src/activate/registerCommands.ts +++ b/src/activate/registerCommands.ts @@ -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)