Skip to content

fix(web): keep thread rename open during IME composition - #6281

Open
MichaelCharles wants to merge 1 commit into
pingdotgg:mainfrom
MichaelCharles:fix/ime-composition-thread-rename
Open

fix(web): keep thread rename open during IME composition#6281
MichaelCharles wants to merge 1 commit into
pingdotgg:mainfrom
MichaelCharles:fix/ime-composition-thread-rename

Conversation

@MichaelCharles

@MichaelCharles MichaelCharles commented Aug 12, 2026

Copy link
Copy Markdown

What Changed

Both thread rename inputs now ignore keydown while an IME composition is in flight:

  • apps/web/src/components/Sidebar.tsx — sidebar inline rename
  • apps/web/src/components/chat/ChatHeader.tsx — header breadcrumb rename

The guard is the one the thread search input in Sidebar.tsx already uses:

if (event.nativeEvent.isComposing || event.keyCode === 229) return;

Two files, one added line each, no new abstraction and no behavior change for non-IME input.

Why

Fixes #6280.

Both handlers committed the rename on any Enter keydown. With a Japanese, Chinese, or Korean IME, Enter is also how you confirm a conversion candidate — so that first Enter committed the title mid-compose and closed the input, discarding everything not yet converted.

Concretely: typing かいけい and pressing Enter to select 会計 saved the thread as 会計, with no way to reach the intended 会計 ARM support. The only workaround was renaming repeatedly, one converted word at a time.

isComposing alone is not sufficient — some platform/IME combinations leave it false mid-composition while keyCode stays 229 — which is why the existing guard in this repo checks both and why this change matches it rather than inventing a new predicate. It also explains why this reproduces on macOS with the Japanese input source but not on Windows with Microsoft IME: whether the confirming Enter reaches the input as a page-level keydown varies by OS, browser, and IME.

Deliberately left alone: handleRenameBlur still commits on blur, and non-composition Enter/Escape behave exactly as before.

UI Changes

No visual change — the input, styling, and layout are untouched. The difference is purely in when Enter commits.

Before: https://github.com/user-attachments/assets/6f097a5b-31d2-461c-a80a-a3f1d6e5c333
After: https://github.com/user-attachments/assets/1b2da9a2-5126-4895-a728-83235c17090e

Verification

Targeted checks only, per AGENTS.md:

  • vp lint on both touched files — clean
  • vp fmt --check on both touched files — clean
  • vp run --filter @t3tools/web typecheck — clean
  • vp test run ChatHeader.test.ts Sidebar.logic.test.ts Sidebar.snooze.test.ts — 3 files, 114 tests passed

No test was added. The keydown handlers are inline in their components, so covering this would mean extracting a predicate and exporting it; that felt like more machinery than a two-line guard warrants, especially with four inline instances of this same pattern already in the codebase. Happy to extract and test it if you would rather have the regression guard.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes — n/a, no visual change
  • I included a video for animation/interaction changes

Note

Fix thread rename inputs to ignore Enter/Escape during IME composition

Adds an early return in handleRenameKeyDown in both Sidebar.tsx and ChatHeader.tsx when event.nativeEvent.isComposing is true or event.keyCode === 229, preventing Enter/Escape from committing or cancelling a rename while the user is mid-composition with an IME.

Macroscope summarized d918691.


Note

Low Risk
Tiny UI keydown guard in rename inputs only; no auth, data, or API changes, and non-IME behavior is preserved.

Overview
Prevents thread rename from committing mid-IME composition when Enter confirms a Japanese/Chinese/Korean candidate.

Adds the existing isComposing / keyCode === 229 guard to handleRenameKeyDown in both Sidebar.tsx and ChatHeader.tsx, matching the pattern already used by thread search. Non-IME Enter/Escape and blur commit behavior are unchanged.

Reviewed by Cursor Bugbot for commit 72a8d92. Bugbot is set up for automated code reviews on this repo. Configure here.

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a63a520b-41ec-4f5e-b07f-87616eb994af

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

@github-actions github-actions Bot added size:XS 0-9 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels Aug 12, 2026
@MichaelCharles
MichaelCharles marked this pull request as ready for review August 12, 2026 07:12
Both thread rename inputs committed on any Enter keydown, including the
Enter that confirms an IME candidate. Renaming a thread with a Japanese,
Chinese, or Korean IME therefore saved the title mid-compose and closed
the input, truncating everything not yet converted: typing かいけい and
pressing Enter to pick 会計 saved the thread as "会計" with no way to
finish the intended title.

Guard both handlers with the composition check the thread search input in
Sidebar.tsx already uses, so Enter reaches the IME while a candidate is
pending and only commits once composition has ended. isComposing alone is
not sufficient because some platform and IME combinations leave it false
mid-composition while keyCode stays 229.

Refs pingdotgg#6280
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Aug 12, 2026
@macroscopeapp

macroscopeapp Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved d918691

This PR adds standard IME composition handling to prevent Enter key from incorrectly committing thread rename during character composition. The fix uses a well-established pattern, is minimal in scope, and has no side effects.

You can customize Macroscope's approvability policy. Learn more.

@MichaelCharles
MichaelCharles force-pushed the fix/ime-composition-thread-rename branch from 72a8d92 to d918691 Compare August 12, 2026 07:16
@macroscopeapp
macroscopeapp Bot dismissed their stale review August 12, 2026 07:17

Dismissing prior approval to re-evaluate d918691

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Thread rename input saves and closes on IME composition Enter, truncating Japanese/CJK text

1 participant