chat: don't restore input focus on touch-tap confirmation clicks#312055
Merged
chat: don't restore input focus on touch-tap confirmation clicks#312055
Conversation
Tapping a tool confirmation button on mobile (iOS) was popping the on-screen keyboard because the click handler unconditionally called focusInput() on the chat widget. Expose isTouchClick on IChatConfirmationButtonClickEvent so callers can skip focus restoration when the click came from a touch tap, while preserving the existing behavior for mouse/keyboard activations. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adjusts chat confirmation UI behavior to avoid re-focusing the chat input after touch-tap confirmations, preventing the on-screen keyboard from popping up on mobile/touch devices.
Changes:
- Extends
ChatConfirmationWidget/SimpleChatConfirmationWidgetclick events to include{ button, isTouchClick }. - Updates tool-confirmation subparts to skip
focusInput()when the confirmation originated from a touch tap. - Updates confirmation/elicitation content parts to match the new click event payload shape.
Show a summary per file
| File | Description |
|---|---|
| src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolConfirmationSubPart.ts | Skips restoring chat input focus after confirmation when the click is touch-originated. |
| src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatModifiedFilesConfirmationSubPart.ts | Skips restoring chat input focus on touch-originated confirmation clicks. |
| src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatExtensionsInstallToolSubPart.ts | Skips restoring chat input focus on touch-originated confirmation clicks. |
| src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/abstractToolConfirmationSubPart.ts | Centralizes “don’t refocus input on touch tap” behavior for generic tool confirmations. |
| src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatElicitationContentPart.ts | Adapts to new confirmation widget click event payload shape. |
| src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationWidget.ts | Introduces IChatConfirmationButtonClickEvent and emits isTouchClick based on Tap vs click. |
| src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationContentPart.ts | Adapts to new confirmation widget click event payload shape. |
Copilot's findings
Comments suppressed due to low confidence (1)
src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationWidget.ts:420
- Same as above: dropdown
moreActionsfireisTouchClick: falseunconditionally. This can cause touch-originated confirmations selected from the dropdown to still restore focus and open the on-screen keyboard. Recommend propagating a touch-derived flag from the dropdown-button interaction into these action callbacks.
return this._register(new Action(
action.label,
action.label,
undefined,
!action.disabled,
() => {
this._onDidClick.fire({ button: action, isTouchClick: false });
return Promise.resolve();
},
));
- Files reviewed: 7/7 changed files
- Comments generated: 2
TylerLeonhardt
approved these changes
Apr 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.