fix(app): guard keydown handlers against IME composition events#20888
Closed
ysm-dev wants to merge 1 commit into
Closed
fix(app): guard keydown handlers against IME composition events#20888ysm-dev wants to merge 1 commit into
ysm-dev wants to merge 1 commit into
Conversation
6 tasks
6 tasks
Collaborator
|
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
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.
Issue for this PR
Closes #20850
Type of change
What does this PR do?
When typing with an IME (Korean, Japanese, Chinese), keydown events fire with
isComposing: truewhile the user is composing characters. Several keydown handlers in the codebase didn't check this property, causing two classes of bugs:Keybind leakage: Pressing
cmd+'during IME composition opened the model select dialog, and the last composed character leaked into the dialog's search input (because the composition was forcibly interrupted and the character committed into the newly auto-focused input).Premature Enter handling: Pressing Enter to confirm an IME candidate (e.g. selecting a Korean syllable) was intercepted by keydown handlers and treated as a form submission — saving inline editors, submitting custom answers, or jumping to the next search result instead of committing the composed character.
The fix adds
if (event.isComposing) returnguards to 7 keydown handlers:command.tsx— global keybind dispatcher (fixes cmd+', cmd+k, cmd+p, etc.)message-timeline.tsx— session title inline editor (Enter to save)inline-editor.tsx— file tree / generic inline editor (Enter to save)session-sortable-terminal-tab.tsx— terminal tab rename input (Enter to save)session-question-dock.tsx— custom answer textarea (Enter to submit) + nav handler (Escape/Cmd+Enter)session.tsx— session page global handler (Escape to blur, auto-focus on keypress)file-find.ts— file search input (Enter to next match)This is the same pattern already used in
list.tsx,use-filtered-list.tsx,line-comment.tsx, andprompt-input.tsx.How did you verify your code works?
cmd+'— model select dialog opens with an empty search input (no leaked character)Screenshots / recordings
N/A — behavioral fix for IME input, no visual change
Checklist