Skip to content

feat(windows): SendInput 模式下可选隐藏键盘列表中的 OpenLess (Fixes #738)#740

Open
HKLHaoBin wants to merge 8 commits into
Open-Less:betafrom
HKLHaoBin:feat/issue-738-keyboard-list-visibility
Open

feat(windows): SendInput 模式下可选隐藏键盘列表中的 OpenLess (Fixes #738)#740
HKLHaoBin wants to merge 8 commits into
Open-Less:betafrom
HKLHaoBin:feat/issue-738-keyboard-list-visibility

Conversation

@HKLHaoBin

@HKLHaoBin HKLHaoBin commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

User description

Summary

  • 新增 \windowsShowOpenlessInKeyboardList\ 偏好:在「始终使用 SendInput」模式下,允许用户选择是否在 Win+Space 键盘列表中显示 OpenLess TSF 输入法。
  • 通过用户级 \EnableLanguageProfile\ 应用/隐藏,无需管理员权限;启动与保存设置时同步,并与 ASR provider sync、prefs 写入组成可回滚事务。
  • 设置页主 SendInput 开关与子开关共用失败 toast +
    efresh()\ 回滚 UI;修复 Hook 顺序问题。

本 PR 基于 SendInput-only 插入模式(#733 相关提交),#738 的键盘列表开关仅在 SendInput 开启时可见。

关联 Issue

Fixes #738

Test plan


  • pm run build\ 通过
  • CI workflow_dispatch 全绿(Android / Linux / Windows)
  • Windows 真机:SendInput on + 关闭子开关 → Win+Space 无 OpenLess
  • 关闭 SendInput → OpenLess 恢复出现在列表
  • TSF apply 失败时 toast 提示,偏好不假保存

Made with Cursor


PR Type

Enhancement


Description

  • Add Windows insertion mode preference (TSF, SendInput, Paste)

  • Add SendInput newline simulation (Enter, Shift+Enter, CR+LF)

  • Option to hide OpenLess from keyboard list in SendInput mode

  • Update settings UI and i18n for new controls


Diagram Walkthrough

flowchart LR
  A["Settings UI"] -- "windowsInsertionMode" --> B["User Preferences"]
  B -- "SendInput" --> C["Skip TSF prepare in dictation"]
  B -- "windowsShowOpenlessInKeyboardList" --> D["TSF profile EnableLanguageProfile"]
  C --> E["insert_via_unicode_keystrokes with options"]
  D --> F["Show/Hide OpenLess in Win+Space list"]
Loading

File Walkthrough

Relevant files
Tests
3 files
backend_rust.rs
Add test harness for Windows modules                                         
+12/-0   
mock-data.ts
Update mock data with new prefs                                                   
+4/-0     
stylePrefs.test.ts
Update test data with new prefs                                                   
+4/-0     
Enhancement
10 files
settings.rs
Refactor persist_settings with keyboard apply and rollback
+274/-11
coordinator.rs
Add SendInput options and insertion mode to dictation error code
+36/-4   
dictation.rs
Use insertion mode to skip TSF prepare and control streaming
+152/-17
insertion.rs
Update insert_via_unicode_keystrokes to accept options     
+47/-65 
lib.rs
Apply keyboard list visibility on startup                               
+11/-0   
types.rs
Add WindowsInsertionMode, WindowsSendInputNewlineMode, and new prefs
+213/-0 
unicode_keystroke.rs
Add newline simulation and typed char counting                     
+161/-8 
windows_ime_profile.rs
Implement keyboard list visibility toggle via TSF profile
+115/-1 
types.ts
Add TypeScript types for Windows insertion mode                   
+14/-0   
RecordingInputSection.tsx
Add UI for insertion mode, newline mode, and keyboard list toggle
+81/-2   
Documentation
5 files
en.ts
Add English i18n keys for new settings                                     
+13/-0   
ja.ts
Add Japanese i18n keys for new settings                                   
+13/-0   
ko.ts
Add Korean i18n keys for new settings                                       
+13/-0   
zh-CN.ts
Add Simplified Chinese i18n keys for new settings               
+13/-0   
zh-TW.ts
Add Traditional Chinese i18n keys for new settings             
+13/-0   

HKLHaoBin and others added 3 commits June 22, 2026 09:27
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>
…mode (Fixes Open-Less#738)

Add windowsShowOpenlessInKeyboardList pref with TSF EnableLanguageProfile apply on startup/save, transactional rollback with ASR sync, and UI error toast/refresh for both SendInput and keyboard-list toggles.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

github-actions Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

PR Reviewer Guide 🔍

(Review updated until commit 0cab357)

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis 🔶

733 - Partially compliant

Compliant requirements:

  • 新增了 windowsSendInputInsertionOnly / windows_sendinput_insertion_only 字段(默认 false)
  • 在 UserPreferences 中添加了 windows_insertion_mode 枚举(Tsf / SendInput / Paste),并兼容旧字段
  • begin_session 条件跳过 prepare_session
  • 一次性插入和流式插入均使用 SendInput 路径(type_unicode_chunk_with_options)
  • 失败兜底仍然由 allow_non_tsf_insertion_fallback 控制
  • 默认关闭时保持原有 TSF 优先链路
  • 设置 UI 已添加(Windows 插入方式选择器、换行模拟选择器)

Non-compliant requirements:

Requires further human verification:

738 - Partially compliant

Compliant requirements:

  • 新增了 windowsShowOpenlessInKeyboardList 偏好(默认 true)
  • 通过 EnableLanguageProfile 启用/禁用语言配置文件实现隐藏
  • 设置 UI 显示「在键盘列表中显示 OpenLess」开关(仅在 SendInput 模式下可见)
  • 启动时自动同步偏好
  • 保存设置时与 ASR provider 组成可回滚事务

Non-compliant requirements:

Requires further human verification:

⏱️ Estimated effort to review: 4 🔵🔵🔵🔵⚪
🧪 PR contains tests
🔒 No security concerns identified
⚡ No major issues detected

@HKLHaoBin

Copy link
Copy Markdown
Contributor Author

更改 13 个文件, 485 行插入(+), 15 行删除(-)

• 引入 WindowsInsertionMode 枚举,用于管理文本插入策略(TSF、SendInput、粘贴)。
• 添加 WindowsSendInputNewlineMode 枚举,用于指定 SendInput 中的换行符处理方式。
• 更新 TextInserter,以支持 Windows 的新插入方法和选项。
• 重构 Unicode 按键处理,以适应换行符模拟模式。
• 增强用户偏好设置,包含新的插入模式及其各自的默认值。
• 更新 UI 组件,允许用户选择首选的插入方法和换行处理方式。
• 改进了英文、日文、韩文、简体中文和繁体中文新设置的本地化。
• 添加了测试以验证新功能,并确保文本插入符合预期行为。
@github-actions

Copy link
Copy Markdown
Contributor

Persistent review updated to latest commit bfd440c

@github-actions

Copy link
Copy Markdown
Contributor

Persistent review updated to latest commit 0cab357

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

能否取消在键盘布局中的显示?

1 participant