actionWidget: fix: resume interrupted IME searches - #335578
Open
Ulugbek Abdullaev (ulugbekna) wants to merge 2 commits into
Open
actionWidget: fix: resume interrupted IME searches#335578Ulugbek Abdullaev (ulugbekna) wants to merge 2 commits into
Ulugbek Abdullaev (ulugbekna) wants to merge 2 commits into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: e4e70d7c-fbe2-487b-a6c5-177af2abae2f
Release settled filter cancellation state without disturbing newer requests. Preserve retries for interrupted composition while avoiding repeat searches after completed success or failure. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: e4e70d7c-fbe2-487b-a6c5-177af2abae2f
Ulugbek Abdullaev (ulugbekna)
requested review from
Logan Ramos (lramos15)
and
a balanced review from Copilot
September 10, 2026 22:16
Copilot started reviewing on behalf of
Ulugbek Abdullaev (ulugbekna)
September 10, 2026 22:16
View session
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
No unresolved blocking issues remain, and the focused regression coverage addresses the revised behavior.
Review tier: Lite
Findings: None
What changed in this PR
Fixes interrupted asynchronous ActionList searches after IME composition while preventing redundant retries and stale cleanup.
Changes:
- Restarts cancelled searches when the query is unchanged.
- Safely clears settled request state.
- Adds regression tests for request lifecycle scenarios.
| File | Description |
|---|---|
src/vs/platform/actionWidget/test/browser/actionList.test.ts |
Adds asynchronous filtering regression tests. |
src/vs/platform/actionWidget/browser/actionList.ts |
Updates IME retry and request cleanup handling. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Ulugbek Abdullaev (ulugbekna)
enabled auto-merge (squash)
September 10, 2026 22:59
Ulugbek Abdullaev (ulugbekna)
disabled auto-merge
September 10, 2026 23:08
This was referenced Sep 10, 2026
Logan Ramos (lramos15)
approved these changes
Sep 11, 2026
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.
Summary
Resume an asynchronous ActionList search that IME composition interrupted, even when composition ends with the original query. Do not repeat searches that already completed or failed, and do not let a stale request's cleanup disturb a newer request.
This is a focused follow-up to #328269. The shared-component fixes are separated from #335018 so the automation changes can be reviewed and landed independently.
Only two files change:
Background and failure
ActionList can filter an existing list locally or delegate filtering to an asynchronous provider through
onFilter. For asynchronous filtering, it owns the current request's cancellation token source in aMutableDisposable.The existing IME handling deliberately defers filtering during composition. Intermediate input can contain uncommitted text, and rebuilding or laying out the result list can disrupt the IME candidate window. Starting a composition also cancels an outstanding search so its results cannot update the list during composition.
Both
compositionendand the accompanyinginputevent eventually use the same value-change handler. That handler originally skipped every unchanged query to deduplicate those events.The failure occurs when:
release, starting an asynchronous request.releaseagain, either after intermediate text or without a committed change.The pending query therefore never supplies fresh results until the user changes the search text again.
How the fix works
1. An unchanged query can restart an interrupted request
The input handler still ignores all changes while composition is active. Outside composition, it skips an unchanged query only when there is no cancelled current request.
This lets
compositionendrestart the search that composition interrupted. The restart immediately replaces the cancelled token source with a live one, so the trailinginputevent for the same text does not issue another request. Existing checks continue to reject results from the cancelled request.2. Settled requests stop looking like pending work
Relaxing the guard alone would introduce an unnecessary retry: previously the current token source remained stored after a search completed or failed. A later
compositionstartcould cancel that already-settled source and make the unchanged query look interrupted.The asynchronous chain now has a
finallyhandler that clears the token source only when:The same cleanup runs after success or failure. Clearing through the existing
MutableDisposabledisposes the source without cancelling an already-settled token, so later composition cannot mark that search as interrupted.The identity check is essential: an older request can settle after a newer request has replaced it. Its cleanup must not clear the newer request's cancellation state. Otherwise composition could neither reliably cancel nor restart the newer request.
A cancelled current request intentionally remains available as the retry signal, even if its promise has already settled. The existing replacement, hide, and disposal paths own its cleanup; no additional collection or long-lived listener is introduced.
Scope and preserved behavior
The interaction remains focused and consistent: the IME retains ownership during composition, and only the interrupted committed query resumes afterward. This is not a visual redesign or a new interactive surface.
Validation
Standalone validation against the main-based branch:
npm run transpile-clientsucceeded and generated fresh output containing both fixes.git diff --checkpassed.The new regression cases cover:
The tests explicitly send the trailing
inputevent to verify deduplication. The existing suites also cover composition suppression, stale-result handling, keyboard and combobox behavior, disposable cleanup, and the two dynamic consumers.Validation used synthetic browser composition events in the Electron unit runner. A native operating-system IME session and manual screen-reader pass were not rerun for this extraction.