Skip to content

fix(web-ui): prevent smart quote substitution in chat input - #3684

Merged
GCWing merged 1 commit into
mainfrom
gcwing/fix-chat-input-smart-quotes
Nov 2, 2026
Merged

GCWing merged 1 commit into
mainfrom
gcwing/fix-chat-input-smart-quotes

Conversation

@GCWing

@GCWing GCWing commented Nov 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

The chat composer can let macOS/WebKit silently replace ASCII apostrophes with smart quotes while typing, changing literal prompt text such as don't. Disable native spellchecking, autocorrection, and autocapitalization on the existing contenteditable composer. Explicitly typed or pasted straight and typographic quotes remain unchanged.

Fixes #3682

Type and Areas

Type: bug fix

Areas: Web UI / desktop chat input

Motivation / Impact

Prompts can contain code, shell commands, and other text where quote characters must remain exact. WebKit gates smart quote and dash substitution through its spellchecking path, so the composer sets spellCheck={false}, autoCorrect="off", and autoCapitalize="off". This also disables native spelling assistance in the composer. No text normalization, persisted data, or transport contracts change.

Verification

AI-assisted change. Testing level: lightly tested (automated DOM and static checks; native macOS input not exercised).

  • pnpm --dir src/web-ui run test:run src/shared/utils/textInputGuard.test.tsx src/flow_chat/components/RichTextInput.test.tsx src/flow_chat/hooks/useComposerDefaultFocus.test.tsx src/flow_chat/utils/chatInputKeyOwnership.test.ts — 4 files / 74 tests passed.
  • The native-correction DOM contract fails on the original component and passes with the fix. Added cases cover completing don' to don't followed by a space, and preserving explicitly authored straight/typographic quotes through input and paste handlers.
  • pnpm run check:web — passed.
  • git diff --check — passed.

The fresh worktree required pnpm run copy-monaco and pnpm --dir src/web-ui run gen:types before the complete Web check; generated artifacts are ignored and not included.

Reviewer Notes

  • Before implementation, refreshed origin/main at b74ea6880 and checked all 19 open PRs, including drafts and overlapping composer diffs. No existing fix covered this scenario.
  • DOM tests verify the rendered opt-out attributes and application character preservation; they do not simulate macOS smart-quote substitution. Browser/desktop automation was not used, as requested.
  • No live remote scenarios were exercised: SSH/container workspace, Remote Control, Peer Device Mode, and Detached Dispatch remain unverified end to end.

Checklist

  • This PR is focused and does not include secrets, temporary prompts, generated scratch files, or unrelated artifacts.
  • Relevant verification is recorded above, or skipped checks are explained.
  • User-facing strings, docs, and locales are updated where applicable (none changed).

@GCWing
GCWing merged commit 2d436f1 into main Nov 2, 2026
9 checks passed
@GCWing
GCWing deleted the gcwing/fix-chat-input-smart-quotes branch November 6, 2026 06:35
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.

[Bug]: Chat input replaces ASCII apostrophe(') (U+0027) with left single quotation mark(‘) (U+2018)

1 participant