Skip to content

fix(ui): respect IME composition in composer - #2844

Merged
esokullu merged 1 commit into
webbrain-one:mainfrom
alectimison-maker:fix/ime-composition-enter
Aug 18, 2026
Merged

fix(ui): respect IME composition in composer#2844
esokullu merged 1 commit into
webbrain-one:mainfrom
alectimison-maker:fix/ime-composition-enter

Conversation

@alectimison-maker

Copy link
Copy Markdown
Contributor

Summary

  • Keep IME composition key events out of the WebBrain composer shortcut handler.
  • Prevent composing Enter from being interpreted as Send in Chrome and Firefox.
  • Add a regression test for composing Enter, keyCode 229 fallback, composing arrows, Shift+Enter, and ordinary Enter.

Motivation

When using a non-English input method, Enter may be required to commit the current composition before the text is complete. The composer previously called preventDefault() and sendMessage() for that keydown, so the input method could not commit the text. This fixes #2841.

Design

  • Return at the start of the user-input keydown handler when event.isComposing is true or the browser reports the IME fallback keyCode === 229.
  • Leave ordinary Enter submission and Shift+Enter multiline behavior unchanged.
  • Mirror the exact guard in Chrome and Firefox.

Testing

  • node test/run.js — 1852 passed; 2 pre-existing upstream baseline failures: the changelog completeness check and the missing dist/webbrain-chrome-32.1.0.zip artifact check.
  • node --check src/chrome/src/ui/sidepanel.js && node --check src/firefox/src/ui/sidepanel.js — passed.
  • npm run test:toolbar-guard — passed (33 tests).
  • npm run test:security — passed (60/60 checks).
  • Chrome unpacked extension replay — passed: composing Enter returned defaultPrevented: false, preserved English draft, and created no user message.
  • Firefox web-ext lint — passed with errors: 0, notices: 0, and 92 existing warnings.

Firefox live sidepanel automation was attempted after installing Firefox 153.0.4 locally, but Firefox Remote Agent rejects direct navigation to the privileged moz-extension:// URL. Firefox source parity and browser-neutral regression coverage are included; native Firefox IME interaction remains untested.

Compatibility and risks

  • No public API, provider, storage, or data format changes.
  • keyCode is used only as a compatibility fallback for IME composition; normal Enter remains keyCode 13 and keeps existing behavior.

Scope

  • Native physical IME validation on Firefox is deferred until the sidebar can be opened through a supported browser automation path.

Closes #2841

The composer intercepted the Enter key used to commit an active IME composition before the input method could finalize the text.
@vercel

vercel Bot commented Aug 18, 2026

Copy link
Copy Markdown

@alectimison-maker is attempting to deploy a commit to the esokullu's projects Team on Vercel.

A member of the Team first needs to authorize it.

@esokullu
esokullu merged commit 90df5a1 into webbrain-one:main Aug 18, 2026
1 of 2 checks passed
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.

fix(ui): do not submit the composer while an IME composition is active

2 participants