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

Tab wrap - tab should not fill all spare space when wrap to new line #113801

Closed
heartacker opened this issue Jan 5, 2021 · 20 comments
Closed

Tab wrap - tab should not fill all spare space when wrap to new line #113801

heartacker opened this issue Jan 5, 2021 · 20 comments
Assignees
Labels
author-verification-requested Issues potentially verifiable by issue author feature-request Request for new features or functionality help wanted Issues identified as good community contribution opportunities on-release-notes Issue/pull request mentioned in release notes verification-needed Verification of issue is requested verified Verification succeeded workbench-tabs VS Code editor tab issues
Milestone

Comments

@heartacker
Copy link
Contributor

image

The latest row should have consistent behavior with the single row

@bpasero bpasero self-assigned this Jan 5, 2021
@bpasero bpasero added under-discussion Issue is under discussion for relevance, priority, approach workbench-tabs VS Code editor tab issues labels Jan 5, 2021
@bpasero
Copy link
Member

bpasero commented Jan 5, 2021

@heartacker the reason tabs currently grow is the following pattern that imho is a bit unpleasant otherwise:

image

As you can see each row would have an uneven gap on the right hand side.

As a workaround, if you configure "workbench.editor.tabSizing": "shrink" tabs will have a fixed width and not grow:

image

@bpasero bpasero changed the title TabWrap should not fill all Spare space when warp to new line Wrapping tabs: should not fill all Spare space when warp to new line Jan 5, 2021
@gjsjohnmurray
Copy link
Contributor

@bpasero how about making them grow on every line except for the last one?

@bpasero
Copy link
Member

bpasero commented Jan 5, 2021

@gjsjohnmurray this is a good idea but to my knowledge there is no CSS rule that we could leverage here because the wrapping is entirely done via the flex layout of the browser. Best we can do is control the growing for the last tab, but not all tabs of the last row.

@sneakyfish5 and @DynDux fyi for CSS tricks maybe I am missing something here.

@bpasero
Copy link
Member

bpasero commented Jan 6, 2021

From #106448 (comment)

image

@jmannanc
Copy link
Contributor

jmannanc commented Jan 7, 2021

Here's an accompanying visual for @DynDux's proposed change:

sMfvSBbQ8t

@heartacker
Copy link
Contributor Author

Here's an accompanying visual for @DynDux's proposed change:

sMfvSBbQ8t

great

@bpasero
Copy link
Member

bpasero commented Jan 7, 2021

Nice, I suggest to continue via a PR.

@bpasero bpasero added the help wanted Issues identified as good community contribution opportunities label Jan 7, 2021
@bpasero
Copy link
Member

bpasero commented Jan 7, 2021

@sneakyfish5 @DynDux given we also have #113926 as an issue I wonder if we should revisit the editor actions toolbar altogether when tabs wrap: what if we simply treat the editor actions toolbar as a "tab", always being the last "tab" in the strip. This would:

Thoughts?

PS: this solution would probably not work for when wrapping is disabled, so it has to be a custom solution only when wrapping is on.

@bpasero bpasero added feature-request Request for new features or functionality and removed under-discussion Issue is under discussion for relevance, priority, approach labels Jan 10, 2021
@bpasero bpasero added this to the Backlog milestone Jan 10, 2021
@DynDux
Copy link

DynDux commented Jan 12, 2021

@bpasero I commented on PR #113926 but see it's closed. So here again:

If the editor actions are just a tab, a clean css-only solution is easy. I created a new fiddle and tried to use the original class names and structure. I also commented the relevant css parts for the layout. Hope it is clear - otherwise please let me know what else you need:

https://jsfiddle.net/seywr7m9/

@bpasero
Copy link
Member

bpasero commented Jan 12, 2021

Yeah thanks, I think the biggest challenge is the actual implementation of the editor actions being a "fake" tab. Unfortunately that is not "just" a CSS change (as far as I can tell), but needs a bit of coding and care because lots of operations assume that the children in the tabs container are all tabs, and not "fake" tabs.

@bpasero bpasero changed the title Wrapping tabs: should not fill all Spare space when warp to new line Wrapping tabs: should not fill all Spare space when wrap to new line Jan 18, 2021
@bpasero bpasero removed their assignment Jan 22, 2021
@bpasero bpasero changed the title Wrapping tabs: should not fill all Spare space when wrap to new line Tab wrap - tab should not fill all spare space when wrap to new line Jan 27, 2021
@jjspace
Copy link

jjspace commented Feb 9, 2021

Any update on this? I like the idea of wrapping tabs but the expanding last row is really throwing me off

@DynDux
Copy link

DynDux commented Feb 9, 2021

@jjspace Until a fix is merged, you can use the extension "Custom CSS and JS Loader" with the following css snippet as a workaround:


.monaco-workbench .part.editor>.content .editor-group-container>.title>.tabs-and-actions-container.wrapping .tabs-container>.tab.sizing-fit {
  flex-grow: 0;
}
.monaco-workbench .part.editor>.content .editor-group-container>.title>.tabs-and-actions-container.wrapping .tabs-container::after {
  content: '';
  flex-grow: 20;
}

@bpasero
Copy link
Member

bpasero commented Feb 9, 2021

Instead of patching our CSS (which we strongly advise against), please see an easy solution via settings in #113801 (comment)

@DynDux
Copy link

DynDux commented Feb 10, 2021

Sorry - of course you are absolutely right! I didn't want to give bad advises and messing with the app shouldn't be done.
I just wanted to help jjspace because setting the "Tab Sizing" to shrink will cut off the filenames which, although intended by the setting, maybe sometimes looks confusing:

image

If I can help to improve the behavior, please let me know!

@clottman
Copy link

Does using "workbench.editor.tabSizing": "shrink", along with "workbench.editor.wrapTabs": true, still work?

When I add in the tabSizing: shrink option, the wrap tabs setting is ignored entirely and everything goes back onto one line.

@bpasero
Copy link
Member

bpasero commented Feb 24, 2021

@clottman yeah that should still work, are you using stable or insiders of VSCode?

recording (1)

@clottman
Copy link

I'm on stable, on mac. Here's some info about my setup:

Version: 1.53.2
Commit: 622cb03f7e070a9670c94bae1a45d78d7181fbd4
Date: 2021-02-11T11:45:54.515Z
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.2.0

image

@bpasero
Copy link
Member

bpasero commented Feb 24, 2021

Can you try to reproduce with our nightly insider builds? You can give our preview releases a try from: https://code.visualstudio.com/insiders/

@clottman
Copy link

Huh, my computer updated this morning from Mac OS 11.1 to mac OS 11.2.1 and it works now, without trying the nightly insider build. Strange.

Thanks for your help!

@bpasero bpasero self-assigned this Mar 1, 2021
@bpasero bpasero modified the milestones: Backlog, March 2021 Mar 1, 2021
bpasero added a commit to bpasero/vscode that referenced this issue Mar 1, 2021
@bpasero bpasero closed this as completed in 3c62a8f Mar 1, 2021
@bpasero
Copy link
Member

bpasero commented Mar 1, 2021

via 3c62a8f the growing of tabs now only applies to the last tab in a row (except for the last row) and the overall result is a much calmer tab sizing behaviour when tabs wrap:

Before
tabs-before

After
tabs-after

@bpasero bpasero added verification-needed Verification of issue is requested author-verification-requested Issues potentially verifiable by issue author labels Mar 19, 2021
@isidorn isidorn added the verified Verification succeeded label Mar 23, 2021
@bpasero bpasero added the on-release-notes Issue/pull request mentioned in release notes label Mar 25, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Apr 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
author-verification-requested Issues potentially verifiable by issue author feature-request Request for new features or functionality help wanted Issues identified as good community contribution opportunities on-release-notes Issue/pull request mentioned in release notes verification-needed Verification of issue is requested verified Verification succeeded workbench-tabs VS Code editor tab issues
Projects
None yet
Development

No branches or pull requests

8 participants