Skip to content

fix: reduce IME composition end Enter tail window from 80ms to 20ms - #387

Open
Is14w wants to merge 1 commit into
Stack-Cairn:mainfrom
Is14w:main
Open

fix: reduce IME composition end Enter tail window from 80ms to 20ms#387
Is14w wants to merge 1 commit into
Stack-Cairn:mainfrom
Is14w:main

Conversation

@Is14w

@Is14w Is14w commented Aug 6, 2026

Copy link
Copy Markdown

Linked issue

Closes #21

Summary

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.

Change scope

  • Modules: agent-gui (desktop frontend), agent-gateway (WebUI mirror)
  • Key paths:
    • crates/agent-gui/src/components/chat/MentionComposer.tsx
    • crates/agent-gateway/web/src/components/chat/MentionComposer.tsx

Screenshots / preview

N/A — this is a single-constant timing change (80ms → 20ms) with no visual effect. The behavior difference is only perceptible by fast typists using IME number-key selection followed immediately by Enter.

image

Verification

  • git diff --check — clean, no trailing whitespace
  • node scripts/check-mirror.mjs — 115 files pass, GUI/WebUI mirrors byte-identical
  • cargo check --manifest-path crates/agent-gui/src-tauri/Cargo.toml --tests — pass (no new warnings)
  • pnpm test:frontend — 2 pre-existing failures unrelated to this change (mention-refetch, presets sync)
  • pnpm lint — pre-existing errors, none introduced by this change
  • Gateway Go tests — skipped, no Go code changed

Pre-submit checklist

  • A requirement issue is linked (or this is a trivial fix that needs no issue, as explained in the summary).
  • Synced with the target branch; no merge conflicts.
  • The change is focused, with no unrelated modifications.
  • No secrets, tokens, or personal data included.
  • Docs are updated for changes affecting user behavior, deployment, or configuration.

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 <noreply@anthropic.com>
@StackCairn
StackCairn marked this pull request as draft August 6, 2026 07:17
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

PR governance checks passed. Awaiting human review.

@Is14w
Is14w marked this pull request as ready for review August 6, 2026 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug:微软中文输入法环境下对话框无法捕获回车

1 participant