[codex] Add Windows TSF IME insertion backend#210
Conversation
|
Persistent review updated to latest commit 31045f7 |
|
请继续看reviewer给出的建议并作出相应更改 |
|
hhhhhh |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 104793cf18
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Persistent review updated to latest commit 2554259 |
|
Persistent review updated to latest commit 104793c |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e040caebf9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| saved: Option<&ImeProfileSnapshot>, | ||
| openless_profile_is_current: bool, | ||
| ) -> ProfileRestoreDecision { | ||
| if saved.is_some() && openless_profile_is_current { |
There was a problem hiding this comment.
Restore saved IME profile after partial activation failure
activate_openless_profile mutates state with ChangeCurrentLanguage before later activation steps can fail; when that happens, restore_decision skips restore whenever OpenLess is not currently active. This leaves the user on a changed keyboard/input profile even though the OpenLess session never became usable. The restore decision should account for failed activation paths with a saved snapshot, not only the "OpenLess still active" case.
Useful? React with 👍 / 👎.
|
Persistent review updated to latest commit e040cae |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Persistent review updated to latest commit 77eb569 |
还要改一下( |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Persistent review updated to latest commit 1de10d3 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9e2c79598a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } | ||
| } | ||
| discard_startup_resources_for_session(inner, session_id); | ||
| restore_prepared_windows_ime_session(inner, session_id); |
There was a problem hiding this comment.
Restore IME snapshot before exposing Idle phase
abort_recording_with_error flips state.phase to Idle before attempting restore_prepared_windows_ime_session. Because restore is guarded by state.session_id, a new dictation can start in that gap, increment the session id, and cause this restore call to discard the old prepared snapshot. In that race, the user’s pre-session IME profile is never restored and the next session can snapshot the already-switched OpenLess profile as baseline. Move restore ahead of publishing Idle (or otherwise make this path restore unconditionally for the failed session) to avoid leaking the IME switch across sessions.
Useful? React with 👍 / 👎.
|
Persistent review updated to latest commit 9e2c795 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ec16958d4d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let state = inner.state.lock(); | ||
| let prepared = { | ||
| let mut slot = inner.prepared_windows_ime_session.lock(); | ||
| take_current_prepared_windows_ime_session_for_restore( | ||
| &mut slot, | ||
| session_id, | ||
| state.session_id, | ||
| ) | ||
| }; | ||
| if let Some(prepared) = prepared { | ||
| inner.windows_ime.restore_session(prepared); |
There was a problem hiding this comment.
Release session mutex before IME restore call
restore_prepared_windows_ime_session keeps inner.state locked while calling inner.windows_ime.restore_session(...), which performs COM/TSF operations (is_openless_profile_active and potentially restore_profile) and can block on the OS input stack. While that call is in flight, all other paths that need state (hotkey edges, cancel, phase transitions) are serialized behind it, so a slow or hung restore can freeze session control. Capture state.session_id first, drop the lock, then run restore to avoid holding the global session mutex across external blocking work.
Useful? React with 👍 / 👎.
|
Persistent review updated to latest commit ec16958 |
User description
Summary
Adds a Windows TSF IME backend for OpenLess dictation insertion and packages/registers it with the Windows build.
This routes Windows insertion through TSF first, with the existing non-TSF fallback path controlled by the fallback setting. The PR also packages the native IME DLLs into the Windows MSI and registers/unregisters them during install/uninstall.
Updates Included
openless-all/app/windows-ime.Fixes Included
TF_E_SYNCHRONOUSrejections with an async TSF edit session.Validation
node scripts/windows-package-msvc.test.mjsOpenLessIme.dllRelease build: 0 warnings, 0 errorsOpenLessIme.dllRelease build: 0 warnings, 0 errorsPR Type
Enhancement, Tests
Description
Add Windows TSF IME insertion backend for dictation
Introduce IME session lifecycle management
Expose Windows IME status and settings
get_windows_ime_statuscommand andallow_non_tsf_insertion_fallbackpreferencePackage and register native IME DLLs for both x64 and Win32
Extend smoke tests and add unit tests for IME components
Diagram Walkthrough
File Walkthrough
11 files
Route dictation insertion through Windows TSF IME with fallback andsession‑aware resource managementImplement TSF IME session preparation, submission, and profilerestoration controllerManage Windows TSF input profiles: capture, activate, restore OpenLesstext serviceDefine named‑pipe IPC protocol and async submit/receive for TSF textinsertionDefine serializable pipe messages and pipe naming conventions for IMEIPCAdd Windows Unicode SendInput inserter and clipboard‑restore fallbackmethodsAddallow_non_tsf_insertion_fallbackpreference and Windows IME statustypes
Register new Windows IME modules and `get_windows_ime_status` commandExpose `get_windows_ime_status` Tauri commandImplement the core TSF text service and edit session commit logicNamed‑pipe client that receives submit requests and reports results2 files
Formatting adjustments (macOS and Windows paste helpers)Minor formatting and line‑break cleanup for global hotkey handlers1 files
Extend smoke test matrix withwin32edittarget and direct insertionnaming
6 files
MSVC packaging script for Windows IME DLLs and MSI registrationBuild script for x64 and Win32 IME DLLsRegister IME COM server and TSF profiles in HKLMUnregister IME COM registration and TSF profilesCOM/TIP category registration helpers for the IME DLLWiX installer fragment to package and register the IME DLLs26 files