fix: enable iOS autocorrect on non-direct terminal entry (#4606)#4699
Open
sudoeren wants to merge 3 commits into
Open
fix: enable iOS autocorrect on non-direct terminal entry (#4606)#4699sudoeren wants to merge 3 commits into
sudoeren wants to merge 3 commits into
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.
Resolves #4606.
Problem
On iPhone, the iOS keyboard's autocorrect bar was suppressed on the non-direct (buffered) terminal command input. Users typing a command in the buffered bar saw no autocorrect suggestions, even though iOS would normally offer them.
Root Cause
mobile/app/h/[hostId]/session/[worktreeId].tsxhadautoCorrect={false}hard-coded on the buffered command<TextInput>(line 4303). The live/direct<TextInput>further up the same ternary (line 4275–4292) already pinsautoCorrect={false}+spellCheck={false}— correctly, since live input forwards raw bytes to the PTY and must not be spell-corrected.The buffered bar in contrast collects a full line and then calls
terminal.sendon submit, so autocorrect is safe to enable and is what the user expects from an iOS keyboard.Fix
Removed the
autoCorrect={false}prop on the buffered<TextInput>. React Native defaultsautoCorrecttotrueon iOS andfalseon Android, which is exactly what the issue asks for ("On iPhone the text entry should enable auto correct"). The live/direct<TextInput>is untouched.Diff
Testing
Added
mobile/src/terminal/session-terminal-entry-autocorrect.test.ts(2 tests):autoCorrect={false}+spellCheck={false}— guards the live branch against accidental removal.autoCorrect={false}norautoCorrect={true}norspellCheck— guards the iOS-default behavior the issue depends on.The tests read the rendered source rather than mounting the 5k-line screen, matching the convention used by
terminal-viewport-refit.test.tsand other mobile source-invariant tests (no React Native render-test infrastructure in this package).pnpm test(mobile) — new 2/2 pass; fix-sanity-checked by reverting the prop and confirming the buffered test fails.pnpm lint(mobile) — cleantsc --noEmit -p tsconfig.json(mobile) — cleanNotes
autoCorrect={false}+spellCheck={false}+keyboardType="ascii-capable"on lines 4283–4286 are kept.