Repository navigation
fix(web-ui): prevent smart quote substitution in chat input - #3684
Merged
Merged
Conversation
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.
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", andautoCapitalize="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.don'todon'tfollowed 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-monacoandpnpm --dir src/web-ui run gen:typesbefore the complete Web check; generated artifacts are ignored and not included.Reviewer Notes
origin/mainatb74ea6880and checked all 19 open PRs, including drafts and overlapping composer diffs. No existing fix covered this scenario.Checklist