Skip to content

fix(desktop): respect IME composition in composer - #38247

Closed
momiji-manjyuu wants to merge 1 commit into
NousResearch:mainfrom
momiji-manjyuu:fix/desktop-ime-composition-enter
Closed

fix(desktop): respect IME composition in composer#38247
momiji-manjyuu wants to merge 1 commit into
NousResearch:mainfrom
momiji-manjyuu:fix/desktop-ime-composition-enter

Conversation

@momiji-manjyuu

Copy link
Copy Markdown

Summary

  • Add an IME composition keyboard-event helper for React/Electron key quirks
  • Ignore composer keydown/keyup handling while text is composing so Enter can confirm Japanese/Chinese/Korean conversion
  • Add regression coverage for composition flags, keyCode 229, Process key, and normal Enter

Test Plan

  • npm run test:ui -- src/app/chat/composer/text-utils.test.ts src/app/chat/composer/slash-nav-dom-repro.test.tsx src/app/chat/composer/rich-editor.test.ts
  • npm run type-check
  • npm run build

Avoid handling Enter, arrow, and process-key events as composer submit or slash-menu navigation while an IME is composing text.\n\nAdds a reusable composition-event helper with regression tests for browser and Electron key-event quirks.
@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the focused IME regression work. The Desktop composer behavior in this PR is already implemented on current main.

Automated hermes-sweeper review:

  • apps/desktop/src/app/chat/composer/index.tsx:364-372 returns before Enter submission and trigger handling while composingRef.current or event.nativeEvent.isComposing is true.
  • apps/desktop/src/app/chat/composer/index.tsx:727-740 tracks composition lifecycle and flushes finalized IME text on compositionend, covering Chromium paths that omit a trailing input event.
  • Commit 0caa23788f6016d3b3216b22fa0203a93152bb99 (merged PR fix(desktop): prevent IME Enter from splitting messages and viewport resize from disarming scroll anchor #38333) introduced the composing-Enter protection; commit 8e629b9f386d12b726bccb32e9d7b48402ea73ea added committed-text synchronization. Current regression coverage is in apps/desktop/src/app/chat/composer/ime-composition-dom-repro.test.tsx:61-106.

Closing as implemented on main.

@teknium1 teknium1 closed this Jul 13, 2026
@teknium1 teknium1 added the sweeper:implemented-on-main Sweeper: behavior already present on current main label Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low — cosmetic, nice to have sweeper:implemented-on-main Sweeper: behavior already present on current main type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants