Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrapped tabs are broken on portrait mode in macOS #116385

Closed
martin-braun opened this issue Feb 10, 2021 · 6 comments
Closed

Wrapped tabs are broken on portrait mode in macOS #116385

martin-braun opened this issue Feb 10, 2021 · 6 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug insiders-released Patch has been released in VS Code Insiders verified Verification succeeded workbench-tabs VS Code editor tab issues
Milestone

Comments

@martin-braun
Copy link

martin-braun commented Feb 10, 2021

Testing #114827

The tabs stop being wrapped when opening some files or closing some tabs. The issue appears randomly. I suspect the bug triggers on specific tab widths.

Visual demonstration:

2021-02-10 23 28 44

VSCode

Version: 1.53.1
Commit: 5d424b828ada08e1eb9f95d6cb41120234ef57c7
Date: 2021-02-08T23:35:15.302Z
Electron: 11.2.1
Chrome: 87.0.4280.141
Node.js: 12.18.3
V8: 8.7.220.31-electron.0
OS: Darwin x64 20.3.0

macOS v11.2.1 (20D74)
MacBook Pro (16-inch, 2019)

@bpasero
Copy link
Member

bpasero commented Feb 11, 2021

@martin-braun can you provide me access to a repository and exact steps for how to reproduce this? We have some conditions under which wrapped tabs will stop to wrap and I wonder if we accidentally hit it here.

@bpasero bpasero added the info-needed Issue requires more information from poster label Feb 11, 2021
@martin-braun
Copy link
Author

martin-braun commented Feb 12, 2021

@bpasero It happens with any project. But I experimented a little bit and found the cause of the problem and how it can be reproduced way easier. The issue is related to a custom zoom level and pixel precision, the math gets messed up for the wrapped tabs when the window is not displayed with 100% zoom.

This is how it can be reproduced, effectively:

  • Open VSCode
  • Zoom out using CMD + - once (your UI gets a little smaller in VSCode)
  • Hit CMD + N rapidly to create many new files
  • Move your window into portrait (more height than width)
  • Resize the window carefully:

2021-02-12 01 05 10

@bpasero bpasero added bug Issue identified by VS Code Team member as probable bug workbench-tabs VS Code editor tab issues help wanted Issues identified as good community contribution opportunities and removed info-needed Issue requires more information from poster labels Feb 12, 2021
@bpasero bpasero added this to the February 2021 milestone Feb 12, 2021
@bpasero
Copy link
Member

bpasero commented Feb 12, 2021

OK thanks I will try to reproduce, might be hard. Open for help if anyone wants to chime in and diagnose.

@bpasero bpasero removed the help wanted Issues identified as good community contribution opportunities label Feb 19, 2021
@bpasero
Copy link
Member

bpasero commented Feb 19, 2021

I think this is entirely related to zooming as it only seems to reproduce with a zoom level of -1. We have a heuristic to disable wrapping tabs when we think that the last tab is large enough that the editor action toolbar is overlapped. With zooming I am seeing some rounding errors when determining this overlap. As a mitigation I pushed a change to allow for up to 1px overlap.

const lastTabOverlapWithToolbarWidth = lastTab.offsetWidth + editorToolbarContainer.offsetWidth - dimensions.available.width;
if (lastTabOverlapWithToolbarWidth > 1) {
// Allow for slight rounding errors related to zooming here
// https://github.com/microsoft/vscode/issues/116385
return false;
}

@bpasero bpasero added the author-verification-requested Issues potentially verifiable by issue author label Feb 23, 2021
@JacksonKearl JacksonKearl added the verified Verification succeeded label Feb 25, 2021
@martin-braun
Copy link
Author

/verified

@github-actions github-actions bot locked and limited conversation to collaborators Apr 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug insiders-released Patch has been released in VS Code Insiders verified Verification succeeded workbench-tabs VS Code editor tab issues
Projects
None yet
Development

No branches or pull requests

4 participants
@bpasero @JacksonKearl @martin-braun and others