Repository navigation
feat(dictation): add short standalone voice commands - #505
Merged
Merged
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 59 minutes. View limit details
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. |
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
Lets short standalone voice commands in English and French (such as "scroll down" or "go back") act directly on the frontmost app instead of being pasted or recorded in History.
Design choice: commands are matched strictly against a small multi-word phrase table (2–6 words, optional single trailing
./!, never?/ellipses/quotes/sentences) right after transcription and before AI cleanup, paste, and History, and dispatched as targeted keyboard shortcuts (Page Down/Page Up,Cmd+[/Alt+Left, etc.) so they always reach the frontmost window regardless of cursor position and work on both macOS and Windows. Off by default and bypassed by Raw dictation.Closes #492
Changes
src-tauri/src/voice_commands.rswith English and French phrase tables (scroll down/up/top/bottom, go back/forward, reload page, next/previous tab, select all, zoom in/out), language scoping (autochecks both,en*/fr*check their list, other languages match none), and main-thread execution guarded byProcessingOperation::try_enter_paste.src-tauri/src/input.rs(macOS layout-aware keycode resolution and multi-modifierFlagsChangedchords) andsrc-tauri/src/input/win32.rs(WindowsSendInputchords withKEYEVENTF_EXTENDEDKEY), plusFrontmostTarget::pidinsrc-tauri/src/clipboard.rs.src-tauri/src/actions.rsbefore AI cleanup, paste, Insights, and History (dropping the uncommitted WAV).voice_commands_enabled(defaultfalse), its Tauri command/ACL/generatedsrc/bindings.ts, the Settings → Transcription → Output toggle (VoiceCommands.tsx), and translations in all six locales (en,fr,de,es,it,pt).tests/voice-commands.spec.ts).Testing
bun run check— passedcargo clippy --locked --all-targets -- -D warnings(insrc-tauri) — passedcargo test --locked --lib(insrc-tauri) — 1772 passed, 0 failed, 34 ignoredPLAYWRIGHT_VITE_PORT=4179 bunx playwright test tests/voice-commands.spec.ts tests/no-all-caps.spec.ts tests/settings-labels-fit.spec.ts tests/settings-organization.spec.ts tests/settings-no-inline-help.spec.ts— 42 passed