Skip to content

webview: Fix find in detached editor windows - #337403

Merged
Dmitriy Vasyura (dmitrivMS) merged 1 commit into
mainfrom
agents/fix-webview-findwidget-issue-233044
Sep 23, 2026
Merged

Dmitriy Vasyura (dmitrivMS) merged 1 commit into
mainfrom
agents/fix-webview-findwidget-issue-233044

Conversation

@dmitrivMS

@dmitrivMS Dmitriy Vasyura (dmitrivMS) commented Sep 23, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #233044

Webview find requests always used the original main window ID. After moving an editor group into an auxiliary window, the main process consequently searched the wrong web contents.

  • Route initial, next/previous, and stop-find requests through the webview's current owning window.
  • Use the existing explicit windowId / webContentsId union to distinguish main-window IDs from auxiliary web-contents IDs, reusing the existing web-contents resolver.
  • Add regression tests for main/auxiliary routing (including identical numeric IDs), navigation, selection clearing, debounce, and cancellation on stop/disposal.

Route find and stop-find requests through the webview's current host, distinguishing main window IDs from auxiliary web contents IDs. Add regression coverage for routing, navigation, debounce, and cancellation.

Fixes #233044

Co-authored-by: Copilot <[email protected]>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The reviewed changes have comprehensive regression coverage and no unresolved issues.

Review effort: Balanced
Findings: None

What changed in this PR

Fixes webview find routing after editors move to auxiliary windows.

Changes:

  • Routes find and stop-find requests through the webview’s current window.
  • Supports main-window and auxiliary web-contents identifiers.
  • Adds regression coverage for routing, navigation, debounce, and cancellation.
File Description
src/​vs/​workbench/​contrib/​webview/​test/​electron-browser/​webviewElement.test.ts Adds find-routing and lifecycle regression tests.
src/​vs/​workbench/​contrib/​webview/​electron-browser/​webviewElement.ts Resolves the webview’s current find target.
src/​vs/​platform/​webview/​electron-main/​webviewMainService.ts Resolves main-window and auxiliary web contents.
src/​vs/​platform/​webview/​common/​webviewManagerService.ts Updates find APIs to accept either identifier type.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@dmitrivMS
Dmitriy Vasyura (dmitrivMS) marked this pull request as ready for review September 23, 2026 04:00
@dmitrivMS
Dmitriy Vasyura (dmitrivMS) merged commit 9cc2a44 into main Sep 23, 2026
54 of 55 checks passed
@dmitrivMS
Dmitriy Vasyura (dmitrivMS) deleted the agents/fix-webview-findwidget-issue-233044 branch September 23, 2026 04:57
Abdon Morales (abdonmorales) pushed a commit to abdonmorales/vscode-utcs that referenced this pull request Sep 23, 2026
Fix webview find in detached editor windows

Route find and stop-find requests through the webview's current host, distinguishing main window IDs from auxiliary web contents IDs. Add regression coverage for routing, navigation, debounce, and cancellation.

Fixes microsoft#233044

Co-authored-by: Copilot <[email protected]>
(cherry picked from commit 9cc2a44)
@vs-code-engineering vs-code-engineering Bot locked and limited conversation to collaborators Nov 7, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

editor-find Editor find operations webview Webview issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Webview Panel with enableFindWidget does not work after Moving Editor Group into New Window

3 participants