Skip to content

Prevent IME composition from submitting chat - #201

Closed
Maklu wants to merge 1 commit into
cloudflare:mainfrom
Maklu:agent/fix-ime-composition
Closed

Prevent IME composition from submitting chat#201
Maklu wants to merge 1 commit into
cloudflare:mainfrom
Maklu:agent/fix-ime-composition

Conversation

@Maklu

@Maklu Maklu commented Aug 14, 2026

Copy link
Copy Markdown

What does this change?

Prevents the chat composer from treating Enter and other keyboard shortcuts as commands while an IME composition is active. This fixes the existing bug reported in #81, where confirming a Chinese, Japanese, or Korean candidate could submit the message.

The guard covers both the standard KeyboardEvent.isComposing signal and the legacy process-key value (keyCode === 229). Focused tests cover composition Enter, legacy process-key Enter, and ordinary Enter.

Why is this obviously correct and trivially verifiable?

The complete behavior is contained in one pure predicate and one early return in the existing keydown handler. When composition is active, the handler does nothing and leaves the event to the IME. When it is not active, execution continues through the unchanged keyboard handling path. The regression tests exercise both branches directly.

Validation

  • pnpm --filter @gadgets/workshop-frontend exec tsc --noEmit
  • pnpm --filter @gadgets/workshop-frontend test (29 files, 153 tests passed)

Checklist

  • This is a small, concrete change; it is not a feature, refactor, or low-value cleanup.
  • I understand that maintainers decide whether the change is obviously correct and trivially verifiable.
  • I have read and followed the contribution guidelines.

Closes #81

@github-actions github-actions Bot added the workshop/frontend Changes to the Workshop frontend label Aug 14, 2026
@github-actions

Copy link
Copy Markdown


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@Maklu

Maklu commented Aug 14, 2026

Copy link
Copy Markdown
Author

Closing this because it overlaps with #140, which was opened earlier and addresses the same IME composition / Enter submission bug. The full scope remains tracked in #81. Apologies for the duplicate, and thanks for taking a look.

@Maklu Maklu closed this Aug 14, 2026
@Maklu
Maklu deleted the agent/fix-ime-composition branch August 14, 2026 05:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

workshop/frontend Changes to the Workshop frontend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enter during IME composition sends the message (Japanese/Chinese/Korean input)

1 participant