Skip to content

fix(app): skip editor reconcile during IME composition#17013

Closed
ysm-dev wants to merge 1 commit into
anomalyco:devfrom
ysm-dev:fix/ime-composition-rerender
Closed

fix(app): skip editor reconcile during IME composition#17013
ysm-dev wants to merge 1 commit into
anomalyco:devfrom
ysm-dev:fix/ime-composition-rerender

Conversation

@ysm-dev
Copy link
Copy Markdown
Contributor

@ysm-dev ysm-dev commented Mar 11, 2026

Fixes #14371
Also related: #15506

What

The contenteditable prompt editor re-renders (reconciles) the DOM whenever the prompt state updates. When IME composition is active (e.g. typing Korean after Shift+Enter), this reconcile destroys the in-progress composition node, causing the first consonant to split off and duplicate to the right of the cursor.

Change

  • Guard the createEffect that syncs prompt state → DOM so it skips reconcile while composing() is true
  • On compositionend, schedule a single deferred reconcile via requestAnimationFrame (bails out if a new composition started in between)
  • Extract the reconcile logic into a shared reconcile() so both the effect and compositionend use the same path

No new dependencies, no behavior change for non-IME input.

Verification

Tested locally on macOS desktop (Tauri) with Korean IME:

  1. Type Korean text → Shift+Enter → type then → correctly produces (no duplicate consonant)
  2. Normal Enter still submits
  3. @mention / slash command popovers still work during typing
  4. bun run typecheck and bun test pass in packages/app

code written by gpt-5.4

@ysm-dev ysm-dev requested a review from adamdotdevin as a code owner March 11, 2026 11:09
@github-actions github-actions Bot added contributor needs:compliance This means the issue will auto-close after 2 hours. labels Mar 11, 2026
@github-actions
Copy link
Copy Markdown
Contributor

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@github-actions
Copy link
Copy Markdown
Contributor

This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.

Feel free to open a new pull request that follows our guidelines.

@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Mar 11, 2026
@github-actions github-actions Bot closed this Mar 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Korean IME: first consonant duplicated after Shift+Enter newline

1 participant