Skip to content

v2: editable row-aligned swipe shortcut menus - #156

Merged
AsafMah merged 5 commits into
v2from
v2_swipe_shortcuts
Sep 15, 2026
Merged

AsafMah merged 5 commits into
v2from
v2_swipe_shortcuts

Conversation

@AsafMah

@AsafMah AsafMah commented Sep 14, 2026 •

Copy link
Copy Markdown
Owner

Summary

Rebuild swipe shortcuts from scratch on the clean v2 baseline. This PR targets v2, not the old fork's main.

  • v2 starts at LeanBitLab/LeanType 2a9d5fecb67c12b834ba2a1e80ffcdc8ab7d6720, with a separate LeanTypeDual branding commit (com.asafmah.leantypedual, version 2.0.0, version code 6000). No old fork input logic was carried over.
  • Swipe down from the bottom character row for a popup aligned with that row: seven QWERTY items line up with z x c v b n m.
  • Swipe up from the top character row; the number row becomes the source when visible.
  • Edit/import/select each menu through the existing Secondary layouts UI. Reuse upstream's layout parser, popup rendering and key actions instead of adding another customization system.
  • Both directions are independently opt-in in Gesture settings. Drag sideways to choose, release to commit, return to the starting height or add another finger to cancel. Menus are unavailable while the device is locked, since custom entries can expose private text or clipboard history.

Lifecycle and glide follow-up

  • Clarified popup input completion, candidate cancellation and coordinate spaces, including accessibility callers. Factored duplicated error reporting without broadening exception handling or changing menu UX.
  • Parameterized every swipe test with glide detection enabled and disabled, using the real gesture arbiter and a positive control that starts and completes an ordinary glide with the expected path.
  • These tests reproduced a real bug: a queued glide-update timer could continue firing under an open shortcut menu. Menu activation now cancels that timer. The same regression fails without the fix and passes with it.

Upstream portability

Apply feature commit a0d63617ac956a17b1836e926b669a8394f67e90, then glide fix c03e95b1f071e632a5c288dea113815d27eaf0c9 and cleanup 0e3f0aefede4234ee6f05c6242bb1953b511e6fe. Fork-only changelog changes are separate commits.

The complete updated implementation, tests and layout documentation applied cleanly to pristine upstream 2a9d5fecb in a detached scratch worktree. All 57 feature/settings tests passed there without the branding commit. No upstream PR has been opened.

Validation

  • 62 focused JVM tests passed on the fork: 27 swipe cases each with glide disabled/enabled (54 executions), 3 settings-wiring tests, and 5 identity tests. JUnit XML was checked for freshness and suite-count integrity.
  • Covered fixed row geometry, number row, split flag, custom layouts and reload, real keyboard-state mode switching, normal period long press, ACTION_CANCEL, second-pointer cancellation including non-distinct multitouch, coalesced motion history, fast release, keyboard changes, lock-screen exclusion, ordinary glide completion/path, queued timers and recovery after shortcut cancellation.
  • An independent review of the lifecycle cleanup and glide fix found no significant issues.
  • Normal native APK build passed for all three flavors: Build debug APK, run 34814979792, built from da4985e936f0d80ceb1ba8b24ce9e1f7ede8656b using the unchanged production Gradle configuration.
  • Downloaded the three APKs and asserted their expected identities with aapt: LeanTypeDual debug label, version 2.0.0 / 6000, flavor-specific fork package IDs, and both arm64-v8a and armeabi-v7a native libraries. APKs are in the workflow's HeliBoard-debug artifact (the inherited artifact name).

Local JVM checks used an external, uncommitted init script selecting installed Build-Tools 36 and disabling native compilation, because the local SDK lacks the pinned NDK and Build-Tools 35. Native proximity JNI is shadowed and the keyboard listener is mocked; gesture arbitration, timers and event delivery are real. The separate successful Linux APK build covers the real native build. The upstream offline unit-test variant has a pre-existing minSdk 21 / graphics-path minSdk 23 manifest conflict, so local JVM tests use standardRunTests. No production build settings were changed for these workarounds.

Remaining manual check

Physical-device swipe feel and native dictionary decoding have not been exercised. Automated coverage now checks glide/shortcut event coexistence, but does not establish decoded-word accuracy or on-device feel. Keep this draft until those manual checks are done.

Build on upstream popup and secondary-layout infrastructure. Preserve row alignment, number-row targeting, key lifecycle and cancellation without importing fork input logic.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 8d01a009-639e-403d-8608-f127da2a4ddc
@AsafMah
AsafMah changed the base branch from main to v2 September 14, 2026 04:10
Keep fork-only release metadata separate from the upstream-portable feature commit.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 8d01a009-639e-403d-8608-f127da2a4ddc
Run swipe regressions with the real gesture arbiter enabled and disabled. Cover normal glide completion and recovery after menu cancellation; reproduce a pending glide timer firing under an open menu and cancel it on activation.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 8d01a009-639e-403d-8608-f127da2a4ddc
Name popup completion and candidate cancellation explicitly, including accessibility callers. Use named coordinate-space arguments and a shared error reporter without changing catch behavior or menu UX.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 8d01a009-639e-403d-8608-f127da2a4ddc
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 8d01a009-639e-403d-8608-f127da2a4ddc
@AsafMah
AsafMah marked this pull request as ready for review September 15, 2026 07:14
@AsafMah
AsafMah merged commit 375cabb into v2 Sep 15, 2026
2 checks passed
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