Skip to content

fix(web): Esc during IME composition no longer wipes the thread find query - #42531

Closed
only21mil wants to merge 1 commit into
pingdotgg:mainfrom
only21mil:fix/web-thread-find-bar-ime-escape
Closed

only21mil wants to merge 1 commit into
pingdotgg:mainfrom
only21mil:fix/web-thread-find-bar-ime-escape

Conversation

@only21mil

Copy link
Copy Markdown
Contributor

In a chat, pressing Ctrl+F opens ThreadFindBar, whose input used type="search". Although the bar's Escape-to-close handler ignores Escape while an IME is composing, Chromium's native default action on search inputs still runs, so pressing Escape to cancel a Japanese/Chinese/Korean composition wipes the whole find query while the bar stays open.

Switching the input to type="text" with role="searchbox" stops the native clear while keeping the accessible role (with role="search" on the bar) and rendering unchanged, matching #41931, #42129, and #42158 (the shared Input type="search" styles only hide WebKit search decorations). Setting enterKeyHint="search" keeps the Search Enter key on phone keyboards; plain Escape still closes find, and Enter / Shift+Enter still step through matches.

Setup

Web on Linux (headless Chromium, 2560x1600), dev build with fresh isolated synthetic data on each commit (no seeded data), server named "Test machine".

Steps

Open a thread → Ctrl+F → type deploy → start an IME composition (か) → press Esc.

Find holds deploy with a Japanese IME composition (か) in progress

Find holds deploy with a Japanese IME composition (か) in progress

424895558f7 (main) e58b2f9a (this PR)
Esc during the composition wipes the whole find query
Esc during the composition wipes the whole find query
Esc during the composition keeps the find query
Esc during the composition keeps the find query

A plain Esc after the composition still closes find

A plain Esc after the composition still closes find

Tests

  • ThreadFindBar.browser.test.tsx drives a real Chromium IME composition and Escape key through CDP and checks the Search key hint; it fails on main (value becomes "") and passes here 3 of 3 runs.
  • vp run check:changed passes.

An AI agent ran each check.

Desktop renders the same web component, and mobile has no thread find.

Generated with Gemini 4 Neon in T3 Code Nightly

@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Nov 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR changes the test suite by +1 test cases (browser +1, unit 0, server 0).

New browser test files: apps/web/src/components/chat/ThreadFindBar.browser.test.tsx.
Each browser test file costs CI seconds of module loading before its first test runs; a unit test costs milliseconds.

Keep tests that would fail for a real reason, and test logic below the UI where it can be. See Testing.

@coderabbitai

coderabbitai Bot commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

ThreadFindBar now uses a text input with searchbox semantics. A browser test checks that Escape during Japanese IME composition does not clear the query.

Changes: ThreadFindBar search input

Layer / File(s) Summary
Search input behavior and browser validation
apps/web/src/components/chat/ThreadFindBar.tsx, apps/web/src/components/chat/ThreadFindBar.browser.test.tsx
The input uses type="text", the searchbox role, and the search enter-key hint. The browser test checks that Escape during IME composition preserves the query and does not report an empty query change.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Low

Suggested reviewers: macroscopeapp

Merge Risk: Minimal · up to e58b2

This change stops Escape during IME composition from clearing the thread find query, and keeps the search role and keyboard hint. The change is small and easy to revert, and no merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: Escape during IME composition no longer clears the thread find query. The change swaps the find input from type="search" to type="text" to stop Chromium's native clear…
Description check Passed The description covers the problem, the change, the scope, and the verification. It explains that Chromium's native search-input clear wipes the query on Escape during IME composition. It explains the…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: Escape during IME composition no longer clears the thread find query. The change swaps the find input from type="search" to type="text" to stop Chromium's native clear. The title uses the conventional commit format with a clear scope and fix type. It matches the changeset and the PR objectives.

Full details: Description check

Explanation

The description covers the problem, the change, the scope, and the verification. It explains that Chromium's native search-input clear wipes the query on Escape during IME composition. It explains the type="text" and role="searchbox" fix, and it links related issues #41931, #42129, and #42158. It reports a browser test that fails on main and passes on the PR, plus before/after screenshots. The Scope section does not link a bug issue or state why none is needed. The author also did not say whether a maintainer asked for the PR. Those gaps are minor, so the description is mostly complete.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 622d65f and e58b2f9.

Files selected for processing: 2

  • apps/web/src/components/chat/ThreadFindBar.browser.test.tsx
  • apps/web/src/components/chat/ThreadFindBar.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.

@juliusmarminge

Copy link
Copy Markdown
Member

Thanks for this. Before a bug fix is taken further, the bug is reproduced on current main, and here it did not appear.

I ran your steps on main at b8be228 in the web client, using headed Google Chrome 151 on Linux with a real Japanese IME (ibus with Mozc) and real keystrokes. I opened a thread, pressed Ctrl+F, typed deploy, started a か composition at the end and pressed Escape. The IME cancelled the composition, the query stayed 'deploy' and find stayed open. A plain Escape afterwards closed find, as expected.

The cleared query in your screenshots and test seems to come from the fake input, not from a real IME. When you fake the composition and send Escape through the DevTools protocol, the page gets an Escape keydown with key 'Escape' while composing, and Chromium's search-input clear runs on that. I saw the same clear when I did it that way. A real IME delivers that keystroke as key 'Process' (keyCode 229) and uses it to cancel the composition, so the search input never clears itself.

If you saw this with a real IME on another platform (macOS or Windows Chrome, say), please tell us which OS, browser version and IME, and we'll take another look.

Closing this pull request. If it still happens for you, please open an issue with the exact steps, what you see, and the version and platform you are on; a fix is picked up from there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants