fix: prevent Enter from sending during IME composition on macOS#97
Merged
GCWing merged 2 commits intoGCWing:mainfrom Mar 9, 2026
Merged
fix: prevent Enter from sending during IME composition on macOS#97GCWing merged 2 commits intoGCWing:mainfrom
GCWing merged 2 commits intoGCWing:mainfrom
Conversation
d80e095 to
5a2e4e9
Compare
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.
PR Title
fix: prevent Enter from sending during IME composition on macOS
Summary
Problem
On macOS Chinese IME (system/Sogou/Tencent), Enter used for candidate confirmation could trigger message send before composition was truly finished.
Root Cause
Send logic depended mainly on
KeyboardEvent.isComposing, which can be transient/insufficient around composition end timing in some IME flows.Fix Details
ChatInput.tsxisImeComposingRef).IME_ENTER_GUARD_MS = 120) to avoid accidental Enter send.RichTextInput.tsxonCompositionStart/onCompositionEndcallbacks.native isComposing || internal composing ref) in key handling.E2E
basic-chat.spec.ts:Validation
npm run type-check/npm run buildinsrc/web-ui: currently fail due to existing repository-wide TS baseline issues unrelated to this PR.tests/e2e npm run test:chat: blocked in local environment by tauri-driver/config startup issues.Changed Files
src/web-ui/src/flow_chat/components/ChatInput.tsxsrc/web-ui/src/flow_chat/components/RichTextInput.tsxtests/e2e/page-objects/components/ChatInput.tstests/e2e/specs/chat/basic-chat.spec.tsRelated