Description
When typing Chinese with an IME (pinyin, Wubi, etc.), pressing Enter while the composition is still in progress (candidates not yet committed / not yet on screen) should confirm the current candidate / commit the text. Instead, ThinkRail sends the chat message directly, so unfinished input is submitted.
Example: typing "你好吗" — after entering ni hao ma, the text box still shows the raw pinyin ni hao ma (not yet committed). Pressing Enter to confirm the candidate "你好吗" sends the message immediately, and the recipient receives the pinyin instead of the Chinese characters.
Steps to reproduce
- Open ThinkRail and focus any chat input box.
- Switch to a Chinese input method (e.g. macOS built-in Pinyin, Sogou Pinyin, Microsoft Pinyin).
- Start typing pinyin in the input box; the IME enters composition state and the box shows the uncommitted pinyin.
- Press Enter while in composition state (intending to confirm the candidate / commit the text).
- Observe: the message is sent immediately, and what is sent is the raw pinyin rather than the composed Chinese characters.
Expected behavior
Pressing Enter during IME composition should only confirm the candidate / commit the text and must not trigger sending. Sending should only happen when Enter is pressed after composition ends (compositionend). This matches the behavior of most chat tools (WeChat, Slack, and standard web chat inputs).
Actual behavior
Pressing Enter during composition triggers the send action, so uncommitted input is sent as a message.
Environment
- OS: macOS / Windows / Linux (reproducible with any pinyin-style IME)
- Bun version: N/A
- Node version: N/A
- ThinkRail version / commit: latest stable (default install script channel)
- IME: pinyin-style Chinese input methods (including macOS native Pinyin)
Possible cause / suggestion
The send shortcut is probably handled only in a keydown listener that checks for Enter, without checking whether the IME is currently composing. Suppress the Enter-send logic during composition via compositionstart / compositionend (or the isComposing flag / event.isComposing).
Description
When typing Chinese with an IME (pinyin, Wubi, etc.), pressing Enter while the composition is still in progress (candidates not yet committed / not yet on screen) should confirm the current candidate / commit the text. Instead, ThinkRail sends the chat message directly, so unfinished input is submitted.
Example: typing "你好吗" — after entering
ni hao ma, the text box still shows the raw pinyinni hao ma(not yet committed). Pressing Enter to confirm the candidate "你好吗" sends the message immediately, and the recipient receives the pinyin instead of the Chinese characters.Steps to reproduce
Expected behavior
Pressing Enter during IME composition should only confirm the candidate / commit the text and must not trigger sending. Sending should only happen when Enter is pressed after composition ends (
compositionend). This matches the behavior of most chat tools (WeChat, Slack, and standard web chat inputs).Actual behavior
Pressing Enter during composition triggers the send action, so uncommitted input is sent as a message.
Environment
Possible cause / suggestion
The send shortcut is probably handled only in a
keydownlistener that checks for Enter, without checking whether the IME is currently composing. Suppress the Enter-send logic during composition viacompositionstart/compositionend(or theisComposingflag /event.isComposing).