Repository navigation
fix(native-chat): preserve IME deletions at composition end - #12281
Conversation
Co-authored-by: fengxinzi1814 <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughNative chat composition-end handling now reprocesses textarea values that differ from the stored draft. Shared draft handling updates history, caret position, autocomplete, and suggestions. Tests cover empty composition values and duplicate prevention. Terminal tests validate incremental macOS Hangul commits, active composition display, and Sogou preedit cancellation without input events. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
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. Comment |
) Co-authored-by: OrcaWin <[email protected]> Co-authored-by: fengxinzi1814 <[email protected]>
Summary
compositionendwhen Sogou/WeChat deletes a preedit without firing a finalinputeventr k s k e k(가나다) terminal contract: two committed syllables plus the visible active third syllable before blurnihao → niha → nih → ni → n → emptywith no trailing input eventCurrent
mainalready fixes the terminal-layer behavior through #12278 and the cancelled-preedit reconciliation, and #12276 directly exercises the native Microsoft Pinyin Shift-toggle trace on Windows. This PR closes the remaining adjacent native-chat gap from #12230 and makes all three reported reproductions explicit regression contracts.The native-chat fix follows the diagnosis contributed by @fengxinzi1814 in #12230, credited as co-author. #12274 by @kcfang independently provides real-macOS Zhuyin evidence for the same empty-preedit terminal shape; current xterm reconciliation already resolves it without adding another terminal listener state machine. #12043 independently identified the Hangul finalizer cause later landed through #12278.
Fixes #12230
Fixes #11914
Fixes #12063
Screenshots
No visual design change. The visible changes are restored IME text:
가나다remains present during the active final composition, and a deleted Sogounstays deleted.Testing
oxfmtandoxlintgit diff --checkAI Review Report
The change was checked against the three native event contracts separately rather than treating CJK IMEs as one path.
가나emitted while xterm's active composition view contains다, matching the pre-click state of the physical-key repro.nihaowithout clearing it or sending a newline.onChangedo not cause a second write.Security Audit
No IPC, transport, command execution, authentication, secrets, path handling, or dependency behavior changes. The native chat handler only copies the current textarea value into its existing draft state through the same path used by
onChange.Notes
Synthetic macOS event coverage is based on the repository's recorded 2-Set and empty-composition shapes. A final physical IME pass on macOS is still worthwhile because CI cannot install and drive Sogou itself; the code no longer depends on a Sogou-specific event ordering beyond
compositionendexposing the live DOM value.