Repository navigation
fix(chat): preserve editing and search during IME Escape - #801
Merged
Merged
Conversation
Ignore composition key events before edit shortcuts and the search Escape handler. Otherwise canceling an IME composition can discard an edit or close search through event bubbling.
Preserve both IME regression coverage and the scheduled-task scenarios added on main when resolving the English and Chinese test-plan conflict.
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.
Pressing Escape to cancel an IME composition can also cancel a message edit or close global search. The edit loses its unsaved draft. In search, the input already ignores composition keys, but the event bubbles to the dialog's unguarded Escape handler.
To exercise the affected paths:
When the key event is marked as composing, the editor and its draft should remain open, and search should stay open. This PR adds the existing composition guard to both handlers: two production lines. Ordinary Escape still cancels/closes; ordinary Cmd/Ctrl+Enter still retries an edit, while composing retry keystrokes are ignored.
Merged current
maininto this branch without rewriting its history. The only conflicts were adjacent additions to the English and Chinese E2E plans; both the IME scenario and main's scheduled-task scenarios are retained.Validation reran after the merge: the actual production components fail with each original handler restored and pass with the fix. Coverage includes bubbling events,
isComposing, legacy keyCode 229, draft preservation, normal Escape (including focus outside the search input), and both retry modifiers. JS build, desktop typecheck, all 2,523 desktop tests, lint/style and documentation checks pass.This is automated Chromium/Electron component evidence using synthetic keyboard events and host-boundary fixtures. Native OS IME candidate-window behavior has not been verified, and no native recording is claimed. The steps above describe the native path to check, not a completed native reproduction.
Validation details
54ba54aee6c91b8fa0a599593ce72244fc26bfaa4413e25cb2d9620a570e042d5353960aff9ab696761de25a1fd3e64120d9a215b066447ddbf3aad8; its tree is identical to the tested candidate (df8b7d719b04cf4c7f060cbb1f5d01bad31e8b80).node scripts/e2e-ime-escape.mjs; oldMessageRowfails with “IME Escape discarded message edit”, oldSearchDialogfails with “Search consumed IME Escape”; fixed candidate passes.pnpm build:js,pnpm --filter @pi-desktop/desktop typecheck,pnpm --filter @pi-desktop/desktop test,pnpm lint,pnpm docs:check,pnpm check:pr-base, upstream-main ancestry andgit diff --check.