Skip to content

fix(two-thumb): grace-commit auto-caps refresh + opt-in tap auto-finish gate#87

Merged
AsafMah merged 2 commits into
devfrom
feat/grace-tap-caps-fixes
Jun 11, 2026
Merged

fix(two-thumb): grace-commit auto-caps refresh + opt-in tap auto-finish gate#87
AsafMah merged 2 commits into
devfrom
feat/grace-tap-caps-fixes

Conversation

@AsafMah

@AsafMah AsafMah commented Jun 10, 2026

Copy link
Copy Markdown
Owner

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)

onCombiningGraceExpired runs on the async grace timer, off the normal onCodeInput path 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 of onCombiningGraceExpired, 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

enterCombiningMode armed the grace timer for any composing word regardless of tap vs swipe (the fromTap param was unused); …AutospaceOnlyAfterGesture only 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, enterCombiningMode skips 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 + SettingsContainerTest case.

Verification

InputLogicTest + SettingsContainerTest116 completed, 3 failed (the AGENTS.md pre-existing baseline), 1 skipped0 new failures; new pref registered.

On-device (building the .dbgtest APK):

  • Caps: type sentences with two-thumb grace on → capitalization should now be correct (sentence-start caps, no mid-word "WORds").
  • Tap gate: Two-thumb settings → "Auto-finish only after swipes" on → tap-typing a word no longer auto-completes; tap-then-swipe still auto-commits.

Gated on your playtest before merge.

AsafMah added 2 commits June 11, 2026 02:24
…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.
@AsafMah
AsafMah merged commit 447c046 into dev Jun 11, 2026
1 check passed
@AsafMah
AsafMah deleted the feat/grace-tap-caps-fixes branch June 11, 2026 05:17
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.

1 participant