Skip to content

chat: enable native autocorrect on web mobile chat inputs#314842

Draft
osortega wants to merge 1 commit intomainfrom
agents/5b6701e4-0605-4a2a-bdd4-fda646e07ddc
Draft

chat: enable native autocorrect on web mobile chat inputs#314842
osortega wants to merge 1 commit intomainfrom
agents/5b6701e4-0605-4a2a-bdd4-fda646e07ddc

Conversation

@osortega
Copy link
Copy Markdown
Contributor

@osortega osortega commented May 6, 2026

Summary

Mobile soft keyboards rely on the input element's autocorrect, autocapitalize and spellcheck attributes to decide whether to run auto-correction and auto-capitalization while typing. Monaco hardcoded all three to off on both the <textarea> and native EditContext input elements, which meant the chat inputs in vscode.dev/agents on a phone got no auto-correction at all — typing prose on a phone there was unforgiving.

Chat inputs are prose, not code, so we want the mobile keyboard's full assistance there.

Changes

  1. New internal editor option inputAids (src/vs/editor/common/config/editorOptions.ts)

    • Default false, no settings schema — internal-only for now.
    • When true, flips autocorrect=on, autocapitalize=on, spellcheck=true on the editor's input element. The autocomplete attribute (form autofill) is intentionally left at off.
  2. Wired through both edit-context implementations

    • src/vs/editor/browser/controller/editContext/textArea/textAreaEditContext.ts
    • src/vs/editor/browser/controller/editContext/native/nativeEditContext.ts
    • Attributes are written from a single helper that runs on construction and on onConfigurationChanged, so the value stays correct across the editor.editContext flip and any other config changes.
  3. Enabled for web mobile only in the two chat input call sites:

    • src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.ts (workbench ChatInputPart)
    • src/vs/sessions/contrib/chat/browser/newChatInput.ts (agents-window NewChatInputWidget)
    • Gate: inputAids: isWeb && isMobile. Other Monaco editors (find widget, rename input, etc.) are unaffected.

Resulting matrix

Surface Desktop (Electron) Web desktop Web mobile
Workbench chat (ChatInputPart) off off on
/agents new-chat (NewChatInputWidget) off off on

Testing

  • npm run compile-check-ts-native — clean
  • npm run valid-layers-check — clean
  • Manual: still need to verify on iOS Safari and Android Chrome that typing into a chat input shows the keyboard's auto-correct suggestions and auto-capitalizes the start of sentences. Both editor.editContext: true and false paths should be exercised.

Why the editor-option approach

We considered a DOM-mutation alternative (querying .inputarea/.native-edit-context after editor creation and flipping the attributes from the chat input itself). The editor-option route was chosen because:

  • it survives the editor.editContext setting flip, which recreates the input element;
  • it doesn't couple chat code to internal Monaco class names; and
  • the existing attribute setting in the two edit contexts was already split across two files — centralizing it via the option is a small cleanup.

The option is intentionally undocumented in user settings; if a future use case warrants it, we can add a schema description.

Mobile soft keyboards rely on the input element's autocorrect,
autocapitalize and spellcheck attributes to decide whether to run
auto-correction and auto-capitalization while typing. Monaco
hardcoded all three to off on both the textarea and native
edit-context input elements, which meant the chat inputs in
vscode.dev/agents on a phone got no auto-correction at all.

- Add an opt-in editor option, inputAids, that flips autocorrect,
  autocapitalize and spellcheck on the input element. autocomplete
  (form autofill) is left off. Default is false; the option has no
  settings schema and is internal-only for now.
- Wire it through both edit context implementations
  (textAreaEditContext, nativeEditContext) so it stays correct
  across configuration changes and across the editor.editContext
  flip.
- Enable inputAids = isWeb && isMobile in the two chat inputs:
  workbench ChatInputPart and the agents-window NewChatInputWidget.
  Desktop, web desktop, and Electron keep the existing behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 6, 2026 20:51
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

Enables native mobile keyboard assistance (autocorrect/autocapitalize/spellcheck) for chat inputs on web mobile by introducing an internal editor option that controls these attributes on Monaco’s input element across both textarea and native EditContext implementations.

Changes:

  • Added a new internal editor option inputAids (default false) to toggle native input aid attributes on the editor input element.
  • Applied inputAids in both textarea- and native-EditContext input implementations, including updating on configuration changes.
  • Enabled inputAids only for web mobile chat inputs in the workbench chat input and the Agents window new-chat input.
Show a summary per file
File Description
src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.ts Enables inputAids for workbench chat input on web mobile only.
src/vs/sessions/contrib/chat/browser/newChatInput.ts Enables inputAids for Agents window chat input on web mobile only.
src/vs/editor/common/config/editorOptions.ts Introduces internal editor option inputAids and registers it (no settings schema).
src/vs/editor/browser/controller/editContext/textArea/textAreaEditContext.ts Centralizes writing autocorrect/autocapitalize/spellcheck on the textarea based on inputAids (constructor + config changes).
src/vs/editor/browser/controller/editContext/native/nativeEditContext.ts Writes autocorrect/autocapitalize/spellcheck on the native EditContext host element based on inputAids (constructor + config changes).

Copilot's findings

  • Files reviewed: 5/5 changed files
  • Comments generated: 0

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.

2 participants