Repository navigation
Learn corrections made right before pressing Enter - #22
Merged
Merged
Conversation
Chat apps send and clear the message on Enter, so the 8 s re-read after a paste found an empty box and never saw the fix. Hushtype now reads the field every second and the instant Return goes down (an active key tap on its own thread, only on while watching), keeps the latest settled read, and learns from it once the text is gone, the next dictation starts, or 90 s pass. Adds a "learning" log category so this can be checked. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01H6HfUTGgwuMj97TiJ3gZVb
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.
Requested by Chiranjeeb · project thread
Problem
"Learn from my corrections" never fired in the usual flow: hold Fn, dictate, fix a word, press Enter. Hushtype only re-read the field 8, 28 and 73 s after pasting. By then a chat app had sent the message and cleared the box, so the fix was never seen.
Change
ReturnKeyTapreads the field at the moment Return goes down, before the app sends. It is an active CGEventTap on its own thread, and it's only on while a watch runs.CorrectionLearner.analyzealso reports whether the dictation is still in the field. Once it's gone (sent, cleared or rewritten), Hushtype learns from the last settled read and stops. It also learns when the next dictation starts or when the 90 s run out.learninglog category. Learned words are logged as private.Testing (on the Mac)
swift buildpasses.swift testran 42 tests with 0 failures, including 3 newCorrectionLearnertests.sayfor the speech:Read 1 fix(es) (Return, counted: true), thenLearned.Dictation no longer in the field (poll), thenLearned, about 0.7 s after Enter.Known limit
Only one-word-for-one-word swaps are learned. If the recogniser splits a word in two (for example "Cuban eats" → "Kubernetes"), the fix isn't learned yet.
Generated by Claude Code