Repository navigation
fix(input): do not commit renames or dialog input on IME-confirming Enter (fixes #516) - #549
Merged
Merged
Conversation
Contributor
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.
Fixes #516: pressing Enter to confirm an IME conversion committed a rename,
alias edit or dialog input mid-composition.
The Enter that confirms an IME conversion still arrives as a keydown with
key === "Enter", so the sidebar alias/rename inputs and the ExtensionDialoginput treated it as a commit.
lib/ime-enter.ts:isImeConfirmEnter()— true when the event is anIME confirmation, identified by either signal:
isComposing, orkeyCode === 229(the IME composition key code). The 229 check coversmacOS Safari, where WebKit delivers
compositionendbefore the confirmingEnter keydown (WebKit bug 165004), so
isComposingis already false.This mirrors the guard ChatInput.tsx already uses for its composer.
components/SessionSidebar-rows.tsx(alias edit andsession rename) and
components/ExtensionDialog.tsx(input dialog).lib/ime-enter.test.mjs(unit) andcomponents/ExtensionDialog.input-ime.test.mjs(a keyCode-229 Enter doesnot submit; a plain Enter does).
Tests (fresh main c110474,
bun test): the new tests pass; the targeted setfor all three issues (11 tests across 4 files) passes.
tsc --noEmitclean.Summary by CodeRabbit