fix: prevent Chinese IME Enter from triggering message send#226
Open
FarewellSagittarius wants to merge 13 commits intoop7418:mainfrom
Open
fix: prevent Chinese IME Enter from triggering message send#226FarewellSagittarius wants to merge 13 commits intoop7418:mainfrom
FarewellSagittarius wants to merge 13 commits intoop7418:mainfrom
Conversation
added 4 commits
March 10, 2026 10:38
On macOS native Chinese IME, compositionend fires before keydown(Enter) when confirming English text, causing isComposing to be false when Enter is handled. Delay the compositionend state reset with setTimeout(0) so the Enter keydown in the same event loop is still suppressed.
# Conflicts: # .gitignore
|
Someone is attempting to deploy a commit to the op7418's projects Team on Vercel. A member of the Team first needs to authorize it. |
added 9 commits
March 13, 2026 15:51
Add Next.js instrumentation hook to trigger bridge auto-start on server startup. Previously auto-start only worked in Electron (main process sent POST to /api/bridge), so launchd/web deployments required manual start.
# Conflicts: # src/instrumentation.ts
On macOS native Chinese IME, compositionend fires before keydown(Enter) when confirming English text, causing isComposing to be false when Enter is handled. Delay the compositionend state reset with setTimeout(0) so the Enter keydown in the same event loop is still suppressed.
Add Next.js instrumentation hook to trigger bridge auto-start on server startup. Previously auto-start only worked in Electron (main process sent POST to /api/bridge), so launchd/web deployments required manual start.
# Conflicts: # src/instrumentation.ts
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.
Summary
Fixes #225
When using macOS native Chinese IME and pressing Enter to confirm English text, the message is sent unexpectedly. This happens because
compositionendfires beforekeydown(Enter)in the same event loop tick, soisComposingis alreadyfalsewhen Enter is handled.Fix: Defer the
isComposingreset withsetTimeout(0)so the Enter keydown in the same cycle is still suppressed.This is a standard pattern used by VS Code, Slack, etc. No impact on non-IME users.
Test plan