From 8720a4ed5e0ad8b809ed467ccffd746e8a1ef0ba Mon Sep 17 00:00:00 2001 From: Is14w Date: Thu, 6 Aug 2026 15:06:42 +0800 Subject: [PATCH] fix: reduce IME composition end Enter tail window from 80ms to 20ms MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The 80ms unconditional suppression window after compositionend was too aggressive — it blocked Enter when users selected IME candidates with non-Enter keys (e.g. number keys) and immediately pressed Enter to send. 20ms is tight enough to still catch the inseparable compositionend→Enter keydown pairs in problematic IME implementations, while avoiding false positives from fast typists. Co-Authored-By: Claude --- .../agent-gateway/web/src/components/chat/MentionComposer.tsx | 2 +- crates/agent-gui/src/components/chat/MentionComposer.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/agent-gateway/web/src/components/chat/MentionComposer.tsx b/crates/agent-gateway/web/src/components/chat/MentionComposer.tsx index c52522236..0761472eb 100644 --- a/crates/agent-gateway/web/src/components/chat/MentionComposer.tsx +++ b/crates/agent-gateway/web/src/components/chat/MentionComposer.tsx @@ -232,7 +232,7 @@ const LARGE_PASTE_LINE_THRESHOLD = 200; const LARGE_PASTE_PREVIEW_CHARS = 160; const CARET_ANCHOR_TEXT = "\u200B"; const IME_ENTER_SUPPRESS_WINDOW_MS = 300; -const IME_COMPOSITION_END_ENTER_TAIL_MS = 80; +const IME_COMPOSITION_END_ENTER_TAIL_MS = 20; // Must match the .composer-typewriter-char animation duration in index.css. const TYPEWRITER_CHAR_FADE_MS = 220; const GITHUB_ICON_SVG = diff --git a/crates/agent-gui/src/components/chat/MentionComposer.tsx b/crates/agent-gui/src/components/chat/MentionComposer.tsx index d3173f9f2..9bb7ab364 100644 --- a/crates/agent-gui/src/components/chat/MentionComposer.tsx +++ b/crates/agent-gui/src/components/chat/MentionComposer.tsx @@ -243,7 +243,7 @@ const COMPOSER_CONTEXT_MENU_HEIGHT = 154; const COMPOSER_CONTEXT_MENU_MARGIN = 12; const CARET_ANCHOR_TEXT = "\u200B"; const IME_ENTER_SUPPRESS_WINDOW_MS = 300; -const IME_COMPOSITION_END_ENTER_TAIL_MS = 80; +const IME_COMPOSITION_END_ENTER_TAIL_MS = 20; // Must match the .composer-typewriter-char animation duration in index.css. const TYPEWRITER_CHAR_FADE_MS = 220; const GITHUB_ICON_SVG =