Skip to content

fix: leave Enter and the arrows to the IME while the search box is composing - #523

Merged
brendt merged 1 commit into
dev-null-sh:productionfrom
jubianchi:fix/search-dialog-ime-composition
Oct 19, 2026
Merged

brendt merged 1 commit into
dev-null-sh:productionfrom
jubianchi:fix/search-dialog-ime-composition

Conversation

@jubianchi

Copy link
Copy Markdown
Contributor

Problem

While an input method editor composes a word (Japanese, Chinese, Korean), the arrows move through its candidates and Enter confirms the word. The browser still delivers those keydowns to the page, flagged isComposing, and the search dialog's onKeyDown acted on them, unlike the issue command, the mention textarea and the conversation thread, which already check event.nativeEvent.isComposing.

Type nihongo with a Japanese IME and press Enter to confirm 日本語: the provisional query matches nothing, so the options are the suggested searches, and that Enter replaces the word with "shipping a side project". When picking a recipient for a remote, it picks whichever developer the half-typed name matched. The arrows move the active result instead of the IME's candidates.

Checked locally with keydowns dispatched with isComposing: true on the empty dialog:

Composing key Before After
Enter field set to "shipping a side project", default prevented nothing
ArrowDown selection moves to the second suggestion nothing

The same keys without composition keep working after the change.

Changes

  1. onKeyDown returns early while composing, so the IME keeps the keys.
  2. tests/Unit/SearchDialogComposition.test.tsx, red before and green after: composing Enter and ArrowDown leave the value and the active option alone and never prevent the default; the plain keys still move the selection and pick a suggestion.
  3. The test is listed in tests/draft-images.config.ts and tests/tsconfig.json; trivial conflicts with test: run the ten component tests that CI never ran #492 and fix: refresh the shared clock when the first component subscribes again #517, which touch the same lists.

…mposing

While an input method editor composes a word (Japanese, Chinese, Korean),
the arrows move through its candidates and Enter confirms the word. The
browser still delivers those keydowns to the page, flagged `isComposing`,
and the search dialog acted on them: the arrows moved the active result,
and Enter opened it. With a provisional query that matches nothing, the
options fall back to the suggested searches, so the Enter that confirmed
the word replaced it with "shipping a side project"; when picking a
recipient for a remote, it picked whichever developer the half-typed name
matched.

Ignore the keys while composing, as the issue command, the mention
textarea and the conversation thread already do, so the IME keeps them.

The test calls the component with mocked hooks, like the composer tests,
and drives the input's handler: composing Enter and ArrowDown leave the
value and the active option alone and never prevent the default, while the
same keys without composition still move the selection and pick the
suggestion.

🤖 Generated with Claude Code
@jubianchi
jubianchi marked this pull request as ready for review October 18, 2026 22:35
@brendt

brendt commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Thanks!

@brendt
brendt merged commit b9a1979 into dev-null-sh:production Oct 19, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants