Repository navigation
Add offline word prediction to the scanning keyboard - #796
Merged
Merged
Conversation
enaboapps
marked this pull request as ready for review
September 19, 2026 11:04
This was referenced Sep 19, 2026
This was referenced Sep 20, 2026
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.
Adds five offline word suggestions to the Letters keyboard page, using the recovered read-only SQLite corpus and actual focused-field context on Windows and macOS. Accepting a word appends its missing suffix and a space. A persisted setting defaults on while retaining compatibility with existing configuration.
Accessibility and database work run in a bounded child process with a two-second timeout. Protected fields, selections, mid-word positions and stale targets suppress acceptance. A temporary Switchify-only fallback starts after a known word boundary when an editable field cannot expose text. Captured text stays in memory and native rendering; no React events, logging, clipboard or learning.
Validation: local Node 24 lint, frontend tests and production build passed. Rust 1.97.1 formatting, warnings-denied Clippy and tests passed. Fake adapters cover extraction, ranking, protection, stale focus/selection, fallback and bounded IPC; a sleeping process verifies cancellation without desktop input. Synthetic database benchmark: 200 samples, median 2.59 ms, p95 10.78 ms, max 14.35 ms, zero failures; startup 251.13 ms (debug). Native app compatibility and end-to-end timings remain untested and are documented explicitly. CI validates Windows/macOS compilation and packaging.
The identity scan now skips binary files so English corpus contents are not mistaken for application branding. All text files remain checked. Corpus provenance and manual fixture instructions are included.
Closes #795
Independent review of latest head ff9ae16 found no remaining actionable findings after fixes for actual captured-switch bindings and observer loss. Final local Rust results: 439 unit tests and 7 integration tests passed, one explicit performance benchmark ignored. The manual measurement command was exercised against a fake worker: 100 supported samples, zero failures, no desktop input. Real app compatibility remains untested.
CI for the previous head ff9ae16 passed: frontend lint/tests/build, dependency audit, CodeQL, Windows native checks and installer verification, and macOS native checks plus app/DMG packaging.
Keyboard redraw fix at 3f062fc: keyboard strokes and prediction acceptance preserve the visible click-through overlay; unchanged tiles skip native repaint. Background geometry changes repaint in stacking order, while pointer execution, stop and failure cleanup retain their existing hiding paths. Fake presentation tests cover changed/unchanged tiles, background changes, removal and failure propagation. Local frontend checks, Mac formatting/Clippy and 442 unit plus seven integration tests passed; Windows ARM VM Clippy, headless tests and native debug build passed. Independent latest-head review found no actionable findings. Updated build is running in the VM for visual user testing; CI for this head is running.
Timing follow-up at e5ee2a5: arriving suggestions that move the scan to their row now restart its interval. Regression coverage verifies arrival at 490 ms of a 500 ms interval still receives a full interval, and unchanged refreshes do not stall scanning. Mac and Windows Rust tests/Clippy and Windows native build passed; independent latest-head review found no actionable findings. Updated VM build is available for user testing; latest CI pending.