fix(desktop): ignore IME composition enter - #38001
Closed
tgfjt wants to merge 1 commit into
Closed
Conversation
Author
|
dup #37483 |
This was referenced Jul 28, 2026
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.
What does this PR do?
This fixes Hermes Desktop submitting a chat message when users press Enter to confirm Japanese/Chinese/Korean IME conversion.
The desktop composer currently handles every non-Shift Enter keydown as submit. During IME composition, the conversion-confirmation Enter also reaches the composer as a keydown event, so confirming text can accidentally send the unfinished message.
This PR adds a small IME composition guard before the submit shortcut runs. It checks both
nativeEvent.isComposingand the browser IME processing key code229, which covers the common macOS/Electron path where composition Enter may not be represented as a normal Enter event. Normal Enter submission remains unchanged.Related Issue
Fixes #37483
Type of Change
Changes Made
apps/desktop/src/app/chat/composer/index.tsxapps/desktop/src/app/chat/composer/ime.tsisImeCompositionKeyEvent()helper fornativeEvent.isComposingand IME processingkeyCode === 229.apps/desktop/src/app/chat/composer/ime.test.tskeyCode === 229, and normal Enter behavior.How to Test
Automated checks run locally:
Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/AScreenshots / Logs