fix(two-thumb): grace-commit auto-caps refresh + opt-in tap auto-finish gate#87
Merged
Conversation
…only after swipes' Two pre-existing bugs in the combining-grace auto-commit path, found on-device (neither caused by #23 — that only defers the space behind a default-off flag). 1. Erratic capitalization after a grace auto-commit. onCombiningGraceExpired runs on the async grace timer, OFF the normal onCodeInput path that refreshes the shift state after a commit — so the next word's auto-caps was stale (dropped, or applied mid-word -> 'WORds'). Fix: call requestUpdatingShiftState(getCurrentAutoCapsState, getCurrentRecapitalizeState) at the end of onCombiningGraceExpired, mirroring the gesture-commit path. Unconditional — it was a bug for every grace commit. 2. No way to stop the grace timer auto-finishing tap-only words. enterCombiningMode armed for any composing word regardless of tap vs swipe (the fromTap param was unused); mCombiningAutospaceOnlyAfterGesture only gates the space, not the commit. Add opt-in PREF_COMBINING_GRACE_ONLY_AFTER_GESTURE (default off): when on, enterCombiningMode skips arming for a tap-only word (no gesture fragment). Tap-then-swipe still arms (the gesture trigger re-enters with the fragment). Verify: InputLogicTest + SettingsContainerTest -> 116 completed, 3 failed (pre-existing baseline), 1 skipped; 0 new failures; new pref registered. Feel (correct caps + tap-skip) validated on-device.
… labels Tapped words auto-finishing was the root of a whole cluster of confusing behavior (premature commit, Text Expander procing early, suggestion-pick appending, garbled words) — so make the swipe-only gate the default. - Default PREF_COMBINING_GRACE_ONLY_AFTER_GESTURE to true (was false). Only affects users who enabled the grace timer (advanced opt-in); for them, tap words no longer auto-finish. - Reworded the two near-identical toggles so they can't be confused: 'Only auto-space after swipes' (the SPACE) vs 'Only auto-finish swiped words' (whether the word COMMITS at all), with disambiguating summaries. - Restructure enterCombiningMode: the gate now suppresses only the TIMER ARMING, not combining-mode entry — so a tap-then-swipe word still extends and auto-finishes (fixed a regression the default flip exposed in tapThenGestureCombiningWordStillAutospaces). Verify: InputLogicTest + SettingsContainerTest -> 116 completed, 3 failed (pre-existing baseline), 1 skipped; 0 new failures.
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.
Fixes two pre-existing bugs in the two-thumb combining-grace auto-commit path, found on-device while testing #86. Neither is caused by #23 — that only defers the space behind a default-off flag; these are in the commit/shift path.
Bug 1 — erratic capitalization after a grace auto-commit (correctness)
onCombiningGraceExpiredruns on the async grace timer, off the normalonCodeInputpath that refreshes the shift state after every commit. So after a grace auto-commit the next word's auto-caps was stale — auto-caps dropped, or applied to the wrong place ("WORds").Fix: call
requestUpdatingShiftState(getCurrentAutoCapsState(sv), getCurrentRecapitalizeState())at the end ofonCombiningGraceExpired, mirroring the gesture-commit path (line ~4008). Unconditional — it was a bug for every grace commit.Bug 2 — taps auto-finished with no way to stop it
enterCombiningModearmed the grace timer for any composing word regardless of tap vs swipe (thefromTapparam was unused);…AutospaceOnlyAfterGestureonly gates the space, not the commit/autocorrect. So tap-typed words got auto-finished and there was no setting to prevent it.Fix: opt-in
PREF_COMBINING_GRACE_ONLY_AFTER_GESTURE(default off). When on,enterCombiningModeskips arming for a tap-only word (no gesture fragment); tap-then-swipe still arms (the gesture trigger re-enters with the fragment present). 5-file pattern +SettingsContainerTestcase.Verification
InputLogicTest+SettingsContainerTest→ 116 completed, 3 failed (the AGENTS.md pre-existing baseline), 1 skipped — 0 new failures; new pref registered.⏳ On-device (building the
.dbgtestAPK):Gated on your playtest before merge.