Repository navigation
fix: leave Enter and Escape to an IME composition in rename and folder fields - #698
Open
wonjangcloud9 wants to merge 1 commit into
Open
wonjangcloud9 wants to merge 1 commit into
wonjangcloud9 wants to merge 1 commit into
Conversation
…r fields Session rename (sidebar), the chat title rename, source/folder naming in the Chains overlay, the sidebar session search and the allowed-folder field acted on Enter and Escape without checking for an IME composition. A Japanese Enter that only confirms a conversion committed the unconverted text and closed the field (a title typed as きょう -> 今日 was saved as "きょう"), and a Japanese Escape that cancels a conversion discarded a new folder. Each handler now returns early while the key belongs to a composition (`isComposing` or keyCode 229), as PathInput, session find and the side thread already do. The folder field also stops propagation for those keys, like PathInput. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Several fields act on Enter or Escape without checking for an IME composition, so Japanese, Chinese and Korean input ends or cancels them early:
RenameRow), the chat title rename (chat.tsx), source/folder naming in the Chains overlay (source-folder-tree.tsx), the sidebar session search, and the allowed-folder field in Settings → Agent.PathInput, session find and the side thread already skip composing keys. These fields didn't.Change
Each handler returns early while the key belongs to a composition (
event.nativeEvent.isComposing || event.keyCode === 229), the same checkPathInputuses. In the folder field the composing key also stops propagation, likePathInput. After the composition ends, Enter and Escape behave as before.The window-level Escape chain (
interaction-layers) already ignores composing keys, so returning early doesn't let a composing Escape close the overlay or abort a turn. The browser check below confirms that for the Chains overlay.Verification
Browser. I ran
npm run devwith an emptyLH_DATA_DIRand{}auth, seeded one chat throughPOST /api/chats, and replayed the key sequences Chrome on macOS delivers. I used puppeteer + CDP (Input.imeSetComposition,Input.insertText,Input.dispatchKeyEventwith keyCode 229), not a physical IME. Same server,main's components vs this branch (hot reload):mainKorean didn't misbehave in the chat title. The rename closes on the first Enter, but the value already holds the composing syllable. The Japanese cases are the visible failures.
Tests. I added
tests/session-rename-ime.test.tsxandtests/source-name-ime.test.tsx. In both, a composing Enter and a composing Escape leave the field open and a plain Enter still commits. Both fail onmainand pass here. linkedom doesn't dispatch towindow, so the overlay part is covered by the browser check, not these tests.npm testpasses: 5271 tests, 0 failures. One earlier run had a single timing-related failure that didn't recur. ESLint is clean apart from the<head>warning thatsource-name-ui.test.tsxalso has.tsc --noEmitreports nothing in the changed files. Its remaining errors are underplugins/, from my checkout's plugin setup.I didn't drive the session search or the allowed-folder field in the browser. Their change is the same one-line guard.
🤖 Generated with Claude Code