Repository navigation
Defer shell searches until IME composition is committed #135
Description
User-facing problem
In the Windows/Linux Tauri shell, composing a Japanese query can start keyword searches and embedding requests for text that has not yet been committed. This can update results while the user is still choosing conversion candidates and starts work for intermediate readings.
For example, while entering 東京, the intermediate text とうきょう should remain under the IME's control. The committed query should then use the existing search behavior.
Evidence on current main
Reviewed at 7db9537712995d14e50e0e44baa00f721b98f1c6.
Both shell/ui/panel.js and shell/ui/window.js bind the input event directly to queryChanged. The keydown handlers already check event.isComposing, but the input/search path does not handle composition state.
A read-only Node VM probe evaluated the current search handlers with an input event marked isComposing: true and the value とうきょう:
- Panel: immediately sends
searchandembed_ahead, then schedules the semantic search. - Main window: immediately sends
embed_ahead, then schedules the semantic search.
This is an event-level reproduction, not a native Windows IME test. Windows WebView2 and Linux WebKit composition event ordering still need to be checked.
Proposed scope
- Track composition in both existing search fields.
- Avoid keyword/embedding/semantic requests for uncommitted composition text.
- Cancel scheduled work and invalidate obsolete replies when composition begins, so earlier results cannot replace the retained results mid-composition.
- Resume the existing search flow when composition ends, avoiding duplicate requests from a trailing input event for the same committed value.
- Preserve ordinary non-IME typing, filters, programmatic query changes, and the current Enter/Escape composition safeguards.
- Preserve keyword matching, ranking, embedding models, storage, and offline behavior.
Validation
Add focused regression tests for the two existing views: composition input does not dispatch searches, pending timers/replies are handled, committed text dispatches once, cancellation has defined behavior, and ordinary typing retains its existing behavior. Run the existing Swift and Rust suites and all shell JavaScript syntax checks. Validate real Japanese IME input on Windows before claiming native Windows behavior.
Scope boundaries
This is separate from the Han filename/body matching work in #85 and #111. It changes when a committed query is submitted, not its search results or matching rules.
Would this focused shell input improvement fit the project's direction? I can prepare a small PR with regression tests if so.
Activity
ARahim3 commentedon Oct 21, 2026
Thanks @Nagi-Inaba, that's a real gap: the key handlers know about composition and the input path doesn't. Yes, please send the PR as you describe it (a composition flag on both fields, one search on the committed text, the tests); it goes into the next Windows and Linux beta. If you can check it with a real Windows IME, say so in the PR; I'll check Linux here.