Add dictation command processing for voice input#1874
Open
liketheduck wants to merge 2 commits intofuto-org:masterfrom
Open
Add dictation command processing for voice input#1874liketheduck wants to merge 2 commits intofuto-org:masterfrom
liketheduck wants to merge 2 commits intofuto-org:masterfrom
Conversation
|
Please sign our contributor license agreement at https://cla.futo.org |
|
Please sign our contributor license agreement at https://cla.futo.org |
3 similar comments
|
Please sign our contributor license agreement at https://cla.futo.org |
|
Please sign our contributor license agreement at https://cla.futo.org |
|
Please sign our contributor license agreement at https://cla.futo.org |
1e707df to
37c69d0
Compare
|
Please sign our contributor license agreement at https://cla.futo.org |
Author
It has been signed |
Adds a post-processing step to the voice input pipeline that converts spoken command phrases (e.g. "new line", "dollar sign", "caps on") into their corresponding characters and formatting. Covers 69 commands across 10 categories, each independently toggleable in a new Dictation Commands settings sub-page under Voice Input. Includes 108 JVM unit tests.
95b8221 to
2a09837
Compare
Whisper often transcribes spoken "exclamation point" as "Exclamation." with capitalization and trailing period. The existing punctuation tolerance handles both; this adds the missing command aliases.
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.
Summary
Adds a post-processing step to the voice input pipeline that converts spoken command phrases into their corresponding characters and formatting. When enabled, phrases like "new line", "dollar sign", "caps on", and "open parenthesis" are replaced with the appropriate output before text is committed to the input field.
Covers 71 commands across 10 categories: formatting, capitalization, punctuation, symbols, math, currency, emoticons, and intellectual property marks. Each category can be independently toggled. The feature is enabled by default and lives behind its own settings sub-page under Voice Input.
Co-authored-by: Claude Code (claude-opus-4-6)
Changes
DictationCommandProcessor.kt-- Core processor. Stateless across calls. Handles multi-word command matching (up to 4 words, longest match first), stateful modes (caps on/off, no space on/off), numeral/roman numeral conversion, and per-command spacing rules. Tolerates Whisper auto-punctuation on command words.VoiceInputAction.kt-- Wired into the voice input pipeline. Sanitizer runs first to clean Whisper output, then the processor handles command substitution.VoiceInputSettingKeys.kt-- 9 DataStore preference keys (master toggle + 8 categories).VoiceInput.kt/SettingsNavigator.kt-- Settings UI. Single navigation item on the Voice Input page opens a dedicated Dictation Commands sub-page with all toggles.strings-uix.xml-- 18 string resources for setting titles and subtitles.build.gradle-- Addedjava/testas a JVM unit test source set.DictationCommandProcessorTest.kt-- 112 unit tests covering all command categories, stateful interactions, edge cases, Whisper punctuation tolerance, and cursor-context spacing.Design decisions
ModelOutputSanitizerso that formatting characters (\n,\t) are not destroyed bytrim().objectsingleton,@JvmStaticentry point, DataStore settings withSettingsKeypattern.Test plan
./gradlew testUnstableDebugUnitTest