feat(windows): 新增「始终使用 SendInput」开关,跳过听写时的 TSF 切换#734
Open
HKLHaoBin wants to merge 2 commits into
Open
Conversation
Add windowsSendInputInsertionOnly so users who cannot restore their IME after dictation can opt into Unicode SendInput without switching to OpenLess TSF at session start. Open-Less#733 Co-authored-by: Cursor <cursoragent@cursor.com>
Serde camelCase produced windowsSendinputInsertionOnly while the UI sends windowsSendInputInsertionOnly, causing the toggle to revert after save. Add explicit rename/alias on UserPreferences wire types and contract tests. Refs Open-Less#733 Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
Contributor
Author
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.

User description
摘要
Fixes #733
新增 Windows 专用 opt-in 开关「始终使用 SendInput(不切换输入法)」。开启后听写 session 不再调用
prepare_session()切换 OpenLess TSF,全程使用 SendInput Unicode 插入。同时修复设置开关保存后立刻回落的问题(serde JSON key 与前端不一致)。修复 / 新增 / 改进
windowsSendInputInsertionOnly/windows_sendinput_insertion_only(默认 false)begin_session条件跳过windows_ime.prepare_session();插入走insert_via_non_tsf_fallbackwindowsSendinputInsertionOnly导致前端 key 被忽略、开关保存回落dictation_error_code单元测试兼容
alias兼容旧错误 key 写入的preferences.json测试计划
npm run build --prefix openless-all/app;CI workflow_dispatch(run 27925685545)全绿cargo test windows_sendinput --lib(Windows CI job 通过)openless-windows-x64preferences.json含"windowsSendInputInsertionOnly": true);听写开始/结束任务栏输入法不变PR Type
Enhancement, Bug fix
Description
Add Windows "Always use SendInput" preference (default off)
Skip TSF IME switch during dictation when preference enabled
Fix serde JSON key mismatch for preference persistence
Add i18n translations and settings UI toggle
Diagram Walkthrough
flowchart LR A["User enables SendInput-only"] --> B{"begin_session"} B -- "pref on" --> C["Skip TSF prepare_session"] B -- "pref off" --> D["TSF as usual"] C --> E["end_session"] E --> F["insert_via_non_tsf_fallback or SendInput"] F --> G["Insert without IME switch"]File Walkthrough
4 files
Make insert_via_non_tsf_fallback pub(super)Implement SendInput-only path in begin/end sessionAdd interface field for SendInput-only preferenceAdd toggle UI for SendInput-only mode1 files
Add windows_sendinput_insertion_only preference with serde fix5 files
Add i18n strings for SendInput-only toggleAdd Japanese i18n for SendInput-only toggleAdd Korean i18n for SendInput-only toggleAdd Simplified Chinese i18n for SendInput-only toggleAdd Traditional Chinese i18n for SendInput-only toggle1 files
Add default value for windowsSendInputInsertionOnly1 files
Add field to test preferences mock