Skip to content

chat: don't restore input focus on touch-tap confirmation clicks#312055

Merged
rebornix merged 1 commit intomainfrom
rebornix/confirmation-touch-focus
Apr 23, 2026
Merged

chat: don't restore input focus on touch-tap confirmation clicks#312055
rebornix merged 1 commit intomainfrom
rebornix/confirmation-touch-focus

Conversation

@rebornix
Copy link
Copy Markdown
Member

No description provided.

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>
Copilot AI review requested due to automatic review settings April 23, 2026 01:55
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/SimpleChatConfirmationWidget click 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 moreActions fire isTouchClick: false unconditionally. 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

@rebornix rebornix merged commit 54cc74d into main Apr 23, 2026
44 of 45 checks passed
@rebornix rebornix deleted the rebornix/confirmation-touch-focus branch April 23, 2026 03:35
@vs-code-engineering vs-code-engineering Bot added this to the 1.118.0 milestone Apr 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants