Repository navigation
feat(autocorrect): apply exact personal dictionary shortcuts to valid typed words - #924
Merged
Merged
Conversation
… typed words A shortcut like "fir" -> "for" was only suggested, never auto-corrected, because "fir" is a valid word and the native dictionary did not mark whether the shortcut key was typed exactly. Flag exact shortcut matches in native output; with Auto-correct shortcuts on, promote such a shortcut to the first suggestion and auto-correct to it, still respecting recently reverted corrections. Fuzzy shortcut matches keep the old behaviour.
LeanBitLab
added a commit
that referenced
this pull request
Nov 26, 2026
The exact-shortcut rule from #924 did not check the source dictionary. Shortcuts of other dictionaries, such as the emoji dictionary, were moved to the first position and auto-corrected, even over a valid typed word. Claude-Session: https://claude.ai/code/session_017YwBxUnnx3DqiiATw5XxUk
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.
Changes
Users with frequent typos that are real words ("fir" for "for", "nit" for "not", reported on r/LeanBitLab_) could not fix them through the personal dictionary: a shortcut entry was only suggested, never auto-corrected, because the typed word is valid. The native dictionary also emitted shortcuts for fuzzy matches without marking which one was typed exactly.
suggestions_output_utils.cpp): shortcut output getsKIND_FLAG_EXACT_MATCHwhen its key equals the typed word (sameAsTyped). No other code reads this flag for shortcuts.Suggest.kt: with Auto-correct shortcuts on, an exact shortcut is promoted to the first suggestion and auto-corrected, even for valid or short typed words. Recently reverted corrections are still respected; fuzzy shortcut matches ("fit" near key "fir") keep the old behaviour.Usage: personal dictionary entry word
for, shortcutfir, plus Text correction > Auto-correct shortcuts.Verification
./gradlew :app:testStandardDebugUnitTest --tests "helium314.keyboard.latin.SuggestTest": 29/29 pass (3 new tests: exact vs fuzzy shortcut, setting off, promotion).