Skip to content

fix: avoid retained webview flash at default iframe size#326482

Open
cipheraxat wants to merge 3 commits into
microsoft:mainfrom
cipheraxat:fix/323890-retained-webview-anchor-visibility
Open

fix: avoid retained webview flash at default iframe size#326482
cipheraxat wants to merge 3 commits into
microsoft:mainfrom
cipheraxat:fix/323890-retained-webview-anchor-visibility

Conversation

@cipheraxat

Copy link
Copy Markdown
Contributor

Summary

Test plan

  • In-product: minimal retainContextWhenHidden custom editor; open → switch to text tab → switch back; first visible overlay/iframe size matches editor bounds (no ≤320×180 flash across reveal samples)
  • Logic: visibility only when owner is set and anchorElement.isConnected
  • Manual: non-retained webviews still show normally
  • Manual: webview views / extension editor that claim without re-anchoring still appear when the prior anchor stays connected

Defer OverlayWebview unhide until a connected CSS anchor is bound so
retained custom editors do not briefly paint at ~300×150 on reveal.
Copilot AI review requested due to automatic review settings July 18, 2026 21:53

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.

Pull request overview

Prevents retained custom-editor webviews from briefly rendering at the iframe’s default size during reveal.

Changes:

  • Defers overlay visibility until ownership and a connected CSS anchor are established.
  • Binds editor anchors before claiming retained webviews.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
webviewEditor.ts Anchors webviews before claiming them.
overlayWebview.ts Gates visibility on ownership and anchor connectivity.

Comment thread src/vs/workbench/contrib/webview/browser/overlayWebview.ts Outdated
cipheraxat and others added 2 commits July 19, 2026 10:28
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Retained custom editor webview briefly renders at default iframe size when switching from a text editor

3 participants