fix: enable scrolling in workbench hover widget when content overflows#312646
Open
galpodlipnik1 wants to merge 2 commits intomicrosoft:mainfrom
Open
fix: enable scrolling in workbench hover widget when content overflows#312646galpodlipnik1 wants to merge 2 commits intomicrosoft:mainfrom
galpodlipnik1 wants to merge 2 commits intomicrosoft:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a workbench hover regression where long hover content is clipped instead of being scrollable by attempting to correctly constrain the hover’s scrollable region when a max height is applied.
Changes:
- Store a reference to a rendered status bar row for height calculations.
- Reset the scrollable element’s
maxHeightat the start of eachlayout()call. - Subtract the status bar height from the hover’s computed max height and apply it to the scrollable region.
33d8130 to
cf4df51
Compare
Add test to verify that `adjustHoverMaxHeight()` constrains the `contentsDomNode` height so `DomScrollableElement.scanDomNode()` can detect overflow and activate scrolling. Also add `lookupKeybinding` stub to the `IKeybindingService` mock so hovers with actions render without errors.
Author
@microsoft-github-policy-service agree |
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.
Fixes #215972
Problem
The hover widget sets
maxHeightoncontainerDomNode(which hasoverflow: hiddenin CSS), but never constrains theDomScrollableElementwrapper inside it. Without a height constraint on the scrollable element,scrollHeightalways equalsclientHeight- the scrollbar never activates. The outer container'soverflow: hiddensimply clips the content invisibly.Fix
_statusBarElement) when actions are rendered in the constructoradjustHoverMaxHeight, setmaxHeightonscrollbar.getDomNode()equal tomaxHeight - statusBarHeight, soDomScrollableElementdetects the overflow and activates the scrollbarscrollbar.getDomNode().style.maxHeightat the start of eachlayout()callTesting
Hover over a terminal tab that has multiple extensions contributing to its environment (e.g. GitLens, GitHub Copilot) - enough to overflow the tooltip. The tooltip should now be scrollable with the mouse wheel instead of clipping the content.