GeezerVison is showing github.com — fix(app): ignore IME-owned composer keys by usrnk1 · Pull Request #62318 · anomalyco/opencode
Conversation
usrnk1
commented
Nov 6, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Summary
Fixes #62290.
- Return before composer focus restoration and shortcut handling when
isComposing is true, or Escape/Enter/Tab carries legacy keyCode: 229.
- Leave native IME handling intact: report the key as handled to the editor without calling
preventDefault().
- Remove the now-redundant composition checks on paging and history arrows. Keep the draft-only Enter guard in
editor.tsx unchanged.
- Restrict the legacy fallback to Escape/Enter/Tab so Android keyboards reporting 229 on other keys retain their existing behavior.
This is the narrow keyboard-ownership fix, not the composition/DOM reconciliation work in #55295. No composition timers, new state, public API changes, or GUI plugin SDK changes. No feature flag: this is a bug fix. Only packages/app changed.
Verification
- Before the fix: 5 new regression rows fail on real controller behavior (IME Escape stops the agent; IME Tab/Enter selects suggestions); 2 plain-key control rows pass.
- After the fix: 7 cases pass, including 10 repeated runs (70/70).
bun typecheck in packages/app: passed.
bun run test:unit: 2,575 passed.
bun run test:browser: 353 passed.
- Prettier and
git diff --check: passed.
bun run lint:changed origin/dev: no problems.
- Pre-push full lint/typecheck check: passed, with existing repository-wide lint warnings.
Native verification
The maintainer reports the quick native macOS Pinyin check passed: Escape dismisses the candidate window without stopping the running agent, and a subsequent plain Escape stops it.
WeChat specifically and Japanese Tab remain untested on native input methods. No before/after recordings were captured. Automated browser-condition tests exercise the real controller with synthetic events, not an OS candidate window or the mounted editor.
Visual
Conceptual illustration, not a recording of native IME verification.
<svg xmlns="http://www.w3.org/2000/svg" width="240" height="72" viewBox="0 0 240 72" fill="none">
<style>@media (prefers-reduced-motion:no-preference){.work{animation:pulse 1.6s ease-in-out infinite}.dismiss{animation:fade 3s ease-in-out infinite}}@keyframes pulse{50%{opacity:.35}}@keyframes fade{0%,30%,100%{opacity:.65}55%,85%{opacity:0}}</style>
<rect x="8" y="30" width="143" height="34" rx="7" stroke="currentColor" opacity=".35"/>
<text x="18" y="51" fill="currentColor" font-family="sans-serif" font-size="12">Prompt</text>
<g class="dismiss" opacity=".65"><rect x="18" y="5" width="74" height="21" rx="4" stroke="currentColor"/><text x="28" y="20" fill="currentColor" font-family="sans-serif" font-size="11">IME · Esc</text></g>
<circle class="work" cx="169" cy="47" r="4" fill="currentColor"/>
<text x="179" y="51" fill="currentColor" font-family="sans-serif" font-size="11">Running</text>
</svg>
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change looks sound. I couldn't verify it against a real IME: that needs the macOS desktop app with a native Chinese input method, which this sandbox doesn't have. At the controller level it works. The new test fails on 5 of its 7 cases against the base code (IME Escape stops the agent, IME Tab/Enter selects the suggestion) and passes in full with this PR. The full test:browser suite (353) and tsc -b also pass.
The early return comes before focus restoration, the suggestion machine, the queue-edit Escape, Stop and history. It returns handled without preventDefault(), so the IME keeps the key. It also correctly skips the editor's Mod+ArrowUp and Enter-to-send paths during composition, and it covers the history and command-menu search input, which shares this handler. Limiting the keyCode 229 fallback to Escape, Enter and Tab keeps the change narrow.
Public API: unchanged (only packages/app internals and a test).
No blocking concerns.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new commit only merges dev. The PR's own change is the same as in my last review, and the new IME test still passes (7/7) on the new head. I still couldn't verify it against a native IME, since that needs macOS with a CJK input method.
Public API: unchanged.
No new concerns.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Nov 7, 2026
Reviewers
Hona
Awaiting requested review from Hona
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
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.
|