Surface next-word predictions after a commit#44
Open
mkpoli wants to merge 1 commit into
Open
Conversation
Wires `CandidateList::predictions` into the live IME so the suggestion
engine keeps working after a word is committed, instead of going dormant
until the next partial word is typed.
After each commit (Kana mode, `context_aware` on), a popup shows the
likely next words with no active composition. Acceptance is number-key
only, so normal typing is untouched:
* 1-9 inserts that prediction as finalized text, then chains into the
prediction for the following word (the sentence-building feel);
* Esc dismisses the popup;
* Space / Enter / any other key passes through unchanged and drops the
popup (a space stays a space).
The popup anchors to the focus caret via the existing `GetGUIThreadInfo`
path, so it positions correctly without a composition. `insert_committed`
mirrors `commit` but opens its own short-lived composition since there is
none while predicting. `context_aware` is the natural off-switch.
Behavioral verification on Windows is still pending — TSF interaction
can't be exercised on Linux. Builds and links for the MSVC target and is
clippy-clean under `-D warnings`.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Stacked on #43 (targets
feat/next-word-prediction-core; retarget tomasteronce #43 merges).Why
#43 added the prediction logic but nothing consumed it. This wires it into the live IME so the engine keeps working after a word is committed — the actual fix for "it only completes one word." Previously, once you committed a word the suggestion engine went dormant (
key_event_sink.rsgated everything on a non-empty buffer) until you typed the next partial word.What
After each commit (Kana mode,
context_awareon), a popup shows the likely next words — no active composition. Per the chosen UX, acceptance is number-key only so normal typing is 100% untouched:Implementation notes:
predictingstate flag distinguishes the predictive popup from the completion popup.GetGUIThreadInfopath (candidate_window.rs), so it positions correctly with no composition.insert_committedmirrorscommitbut opens its own short-lived composition (there is none while predicting).context_awareis the natural off-switch — no new config surface.Verification
x86_64-pc-windows-msvc(cargo xwin build --release); exports intact.cargo clippy -D warningsclean on the MSVC target.To verify on Windows
suggestions.context_aware = false→ popup should not appear.