Skip to content

Conversation

@SanketBaviskar
Copy link

@SanketBaviskar SanketBaviskar commented Dec 10, 2025

Description

Fixes #282039

When the VS Code window is shrunk to a small size, a horizontal scrollbar appears in the workbench grid. Scrolling this scrollbar caused the webview overlay (e.g., Release Notes) to remain "stuck" in place while the rest of the UI scrolled.

Root Cause

The WebviewEditor only listened to part.onDidScroll events from the editor part's grid. However, when the window is very small, the scroll happens at the workbench grid level (parent of the editor part), which wasn't being captured.

Solution

Added a scroll event listener on the main workbench container with capture: true to catch scroll events from any child element, including the workbench grid's split view. This ensures the webview overlay is repositioned whenever any scroll occurs in the workbench.

Testing

  1. Open VS Code
  2. Open a markdown file
  3. Run command "Developer: Open Current File as Release Notes"
  4. Open the Chat panel (auxiliary bar) on the right
  5. Shrink the window horizontally until a horizontal scrollbar appears
  6. Scroll horizontally using the scrollbar
  7. Before fix: Webview content stays "stuck" while UI scrolls
  8. After fix: Webview content scrolls with the rest of the UI

Checklist

Fixes microsoft#282039

When the VS Code window is small and the workbench grid shows a
horizontal scrollbar, scrolling would leave the webview overlay
stuck in place while the rest of the UI moved.

Added a scroll listener on the main workbench container to
synchronize webview dimensions when scrolling occurs at any level.
Copilot AI review requested due to automatic review settings December 10, 2025 19:40
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes an issue where webview overlays (like Release Notes) remained "stuck" in place when scrolling the workbench grid's horizontal scrollbar on small window sizes. The root cause was that the WebviewEditor only listened to scroll events from the editor part, not from the parent workbench grid container.

Key Changes:

  • Added a scroll event listener on the main workbench container with capture: true to catch scroll events from any child element
  • This ensures synchronizeWebviewContainerDimensions is called to reposition the webview overlay during any workbench scroll

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Chat panel blends into release notes when the window is narrow

2 participants