Repository navigation
fix(agent): preserve IME composition on Enter - #116
Open
LIU-JUNYANG wants to merge 1 commit into
Open
LIU-JUNYANG wants to merge 1 commit into
LIU-JUNYANG wants to merge 1 commit into
Conversation
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
Problem
A user reported that typing English with a Chinese input method on macOS and pressing Return to confirm the text also sends the message. The report is from 3.0.0+49; the same keyboard handler is present on current master (3.0.0+50).
AgentComposer._handleKeyEventpreviously treated every Enter key-down without Shift as a submit, without checking the text controller's composing state. The new check runs before either submitting or inserting a newline, so the composer does not consume Enter while composition is active.Validation
dart format --output=none --set-exit-if-changed lib/agent/agent_composer.dart test/agent_composer_test.dart: passed.flutter test --no-pub test/agent_composer_test.dart: 17 passed.flutter test --no-pub --reporter expanded: 1,077 passed, 1 skipped, exit 0.flutter analyze --no-pub: exit 1 with three existingdeprecated_member_useinfo diagnostics inlib/data/local/app_database.g.dart:15723andlib/servers/maidcafe_push.dart:300,345; none in the changed files.git diff --check: passed.The widget tests simulate IME composing state and keyboard events. The patched application has not been manually tested with a native macOS Chinese input method, so native IME event ordering and the original GUI reproduction still need confirmation. This change is limited to the composer's keyboard handler; it does not change the text-input action callback.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.