Skip to content

Conversation

@setmao
Copy link

@setmao setmao commented Jan 18, 2026

Description

Fixes the issue where comments are submitted prematurely when using Chinese/Japanese/Korean input methods (IME). When pressing Enter to select a character from the candidate list, the comment was being submitted instead of completing the character selection.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Improvement (change that would cause existing functionality to not work as expected)
  • Code refactoring
  • Performance improvements
  • Documentation update

Screenshots and Media (if applicable)

Screen.Recording.2026-01-19.at.1.48.15.AM.mov

Test Scenarios

  1. Use Traditional Chinese input method (注音輸入法) or any other IME
  2. Go to Work Items and open the comment section
  3. Type phonetic symbols and press Enter to select a character
  4. Verify the character is selected without submitting the comment
  5. Verify emoji suggestions don't interfere with character selection

References

Fixes #4134

Summary by CodeRabbit

  • Bug Fixes
    • Improved input handling for users typing with non-Latin input methods (Chinese, Japanese, Korean, etc.) to prevent premature comment or content submission and ensure text input is properly completed before processing.

✏️ Tip: You can customize this high-level summary in your review settings.

Copilot AI review requested due to automatic review settings January 18, 2026 17:52
@CLAassistant
Copy link

CLAassistant commented Jan 18, 2026

CLA assistant check
All committers have signed the CLA.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 18, 2026

📝 Walkthrough

Walkthrough

The changes add IME (Input Method Editor) composition guards across the comment submission system and editor extensions to prevent unintended submissions and operations during Chinese/Japanese/Korean text input. Guard clauses now check composition state before triggering Enter key submissions, emoji replacements, trailing node insertions, and unique ID generation.

Changes

Cohort / File(s) Summary
Comment submission guards
apps/web/core/components/comments/card/edit-form.tsx, apps/web/core/components/comments/comment-create.tsx
Added !e.nativeEvent.isComposing check to Enter key handlers to prevent comment submission when IME composition is in progress
Editor extension composition guards
packages/editor/src/core/extensions/emoji/emoji.ts, packages/editor/src/core/extensions/enter-key.ts, packages/editor/src/core/extensions/trailing-node.ts
Added early-return guards checking this.editor.view.composing to skip emoji replacement, Enter key submission, and trailing node insertion during IME input
UniqueID plugin updates
packages/editor/src/core/extensions/unique-id/extension.ts, packages/editor/src/core/extensions/unique-id/plugin.ts
Updated createUniqueIDPlugin function signature to accept optional editor parameter; added composition state guard in appendTransaction to prevent ID generation during IME composition

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 When Eastern keyboards dance and sway,
The rabbit hopped the bugs away!
No more submissions, quick and rash—
Compose in peace, no accidental splash! 🎌
With guards in place, the flow runs true,
Chinese characters see it through. ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main fix: preventing premature submission during IME composition. It directly relates to the core problem being addressed across multiple file changes.
Linked Issues check ✅ Passed The PR successfully addresses issue #4134 by adding IME composition guards across the editor to prevent Enter key submission during Chinese character selection and blocking emoji suggestions during composition.
Out of Scope Changes check ✅ Passed All changes are directly scoped to fixing IME composition handling. The UniqueID plugin parameter addition supports the composition guard implementation and is within scope.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a bug where comments were being submitted prematurely when using Chinese, Japanese, or Korean (CJK) input methods (IME). The issue occurred when users pressed Enter to select a character from the IME candidate list, which triggered comment submission instead of completing character selection.

Changes:

  • Added IME composition checks to editor extensions to prevent document modifications during character composition
  • Added IME composition checks to React event handlers to prevent form submission during character selection
  • Passed editor instance to plugins that need to check composition state

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/editor/src/core/extensions/unique-id/plugin.ts Added editor parameter and IME composition check in appendTransaction to skip ID generation during composition
packages/editor/src/core/extensions/unique-id/extension.ts Updated plugin instantiation to pass editor instance
packages/editor/src/core/extensions/trailing-node.ts Added IME composition check to prevent trailing node insertion during composition
packages/editor/src/core/extensions/enter-key.ts Added IME composition check to prevent Enter key handling during character selection
packages/editor/src/core/extensions/emoji/emoji.ts Added IME composition check to prevent emoji replacement during composition
apps/web/core/components/comments/comment-create.tsx Added isComposing check to prevent form submission during IME composition
apps/web/core/components/comments/card/edit-form.tsx Added isComposing check to prevent form submission during IME composition

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@setmao
Copy link
Author

setmao commented Jan 21, 2026

Hi @anmolsinghbhatia, could you help review this PR when you have time? It fixes an IME composition bug affecting CJK input users in the editor/comments. The changes touch packages/editor extensions and comment forms in apps/web. Thanks!

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]: Issue with Premature Comment Submission during Chinese Character Selection

2 participants