Repository navigation
Hold suggestions until the next word after context is lost mid-word - #927
Merged
Merged
Conversation
When the prediction context is cleared inside a word and the caret has not moved away, nothing is sent to the worker until a character that ends the word is typed. The main process tracks only whether each typed character was part of a word, never the text. Closes #926 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Review follow-up: a failed acceptance, a failed Enter, Tab or shortcut, and a shortcut inside a word now hold. Navigation keys always hold. Backspace into text the worker never had holds, and Backspace back to a word boundary releases. An observer that is not running no longer ends a hold. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Review follow-up: a space typed and deleted again after navigation or a Backspace into unseen text holds again. The observer starting again no longer ends a hold, the failed punctuation test asserts the hold, and the native validation steps describe the held cases. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.
Closes #926
Problem
After the prediction context was cleared in the middle of a word, the remaining letters were completed as if they began a new word. After
hel, a furtherlcould be completed tolike, leavinghellike.Change
Suggestions are held until a character that ends the word is typed, then resume with the next word. The badge reads "Suggestions resume next word" while held.
No pipe message, protocol interface or persisted schema changes.
Behaviour changes to be aware of
Both were cases where the old behaviour could complete a fragment into the wrong word. A hold costs at most one word of suggestions and never changes what is typed.
Difference from the issue
The issue proposed holding after any reset. Window changes and outside activity are excluded, because the caret may then be anywhere and typing usually starts a new word.
Validation
All run locally on Windows and passing:
npm run prediction-modelnpm run lintnpm testnpm run buildcargo fmt --manifest-path src-tauri/Cargo.toml --checkcargo clippy --manifest-path src-tauri/Cargo.toml --all-targets -- -D warningscargo test --manifest-path src-tauri/Cargo.toml: 583 passedNew tests call the service directly with fake strokes and inject no input.
Not covered by a test: the failed acceptance path, which sits inside
polland needs an app handle. Not verified: behaviour in the running app.🤖 Generated with Claude Code