Skip to content

fix: keep backspace acceleration consistent across composing states - #503

Draft
Dvredin wants to merge 2 commits into
LeanBitLab:mainfrom
Dvredin:fix/consistent-backspace-acceleration
Draft

fix: keep backspace acceleration consistent across composing states#503
Dvredin wants to merge 2 commits into
LeanBitLab:mainfrom
Dvredin:fix/consistent-backspace-acceleration

Conversation

@Dvredin

@Dvredin Dvredin commented Sep 9, 2026

Copy link
Copy Markdown

Problem

In 4.2.2, accelerated Backspace performs a second deletion only in the committed-text branch. The composing-word branch performs one deletion per event even after the same acceleration threshold. Deleting a space can resume the previous word, so a held Backspace changes its deletion budget as it crosses between the two states.

This is a narrowly scoped consistency fix, related to the held-Backspace part of #439. It does not implement that issue's vertical selection gestures or new acceleration curves and should not close the whole issue.

Change

  • Keep the existing deletion counter, threshold and timing policy.
  • Separate one Backspace action from the decision to perform an accelerated second step.
  • Apply the same extra-step policy to ordinary composing and committed-text deletion.
  • Process the extra logical deletion through the combiner against the updated state, instead of applying the original processed event twice or deleting behind WordComposer's back.
  • Keep selection deletion, autocorrection undo, gesture-word rejection and shortcut expansion/reversion as single actions.
  • Defer committed-word suggestion resumption until the final step, and avoid an extra step after reaching the start of the editor.

No dictionary/scoring changes, swipe-library changes, settings, translations or dependency upgrades.

Verification

  • Added eleven regression/guard scenarios to the existing Robolectric InputLogicTest (not a standalone reimplementation of the logic).
  • On unchanged production code, the three acceleration scenarios fail: composing word, resumed committed word, and crossing out of composition. On the patch, the complete InputLogicTest passes: 86 tests, zero failures.
  • :app:testStandardfullRunTestsUnitTest: 218 tests discovered, 5 skipped, zero failures/errors.
  • :app:compileOfflineRunTestsKotlin (the current PR workflow command): passes locally.
  • git diff --check: passes.
  • Clean verification: ./gradlew clean :app:testStandardfullRunTestsUnitTest :app:assembleStandardfullDebug :app:compileOfflineRunTestsKotlin passes. Test totals remain 218 discovered, 5 skipped, zero failures/errors. APK signature and 16 KiB ZIP alignment checks pass. The debug package is separate from the release installation. Physical-device installation/behavior are not yet tested.
  • :app:lintStandardfullDebug: fails on both unchanged 4.2.2 and this patch with 1018 errors, 623 warnings and 11 hints. A normalized report comparison on follow-up ca5bd73 found identical diagnostics, with no additions or removals. This is not a green-lint claim.
  • Upstream GitHub Actions run 34386995467 is action_required (fork workflow requires maintainer approval), not a CI pass.

The initial offline unit-test variant failed during test-manifest merging because its minSdk is 21 and androidx.graphics:graphics-path:1.1.0 requires 23. Standard Full uses minSdk 23; the test source and fix are shared. No SDK/dependency workaround was added to this PR. The offline compile task above passes.

Review follow-up

The first revision (6862fbe) was found to unlearn multiple intermediate prefixes during one accelerated committed deletion and skip suggestion resumption when the defensive selection query found a selection. Follow-up ca5bd73 preserves the baseline's successful-unlearning guard and restores the selection branch's post-delete handling without an extra deletion.

Two additional regression tests pass on unchanged 4.2.2, fail on the first revision, and pass with the follow-up. The original test APK has been withdrawn and replaced; use only the follow-up build. Clean tests, APK build and the offline compile task were repeated after the follow-up.

Draft / device validation

Physical-device validation is pending with the reporter. The reproducible unit tests establish the number of deletion steps and state consistency, not a measured UI latency improvement. The reported intermittent slowdown may also involve InputConnection latency or other independent causes, which this PR does not attempt to fix.

Please review the approach before merging; this remains a draft until manual checks cover holding across word boundaries, ordinary taps, selected text, autocorrection undo and emoji.

AI-assisted implementation; automated evidence and remaining device-validation limits are stated above.

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