-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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
Add pinned tab button (icon) control setting #196896
Add pinned tab button (icon) control setting #196896
Conversation
Thanks for the PR, we were considering doing something in this direction so this helps a lot! There is one main thing missing. Some people don't want the pinned tab button on the top row but still want to have the close button. This is currently not possible with this change. I suggest when the user picks |
I suggest to change this a bit. I don't see the beneefit of having close action right and unpin action left. Introducing this will also break the current users settings when updating. I suggest to have the following settings:
What do you think @n-gist ? Are you up to makeing the change? I can give you some pointers if you need help, otherwise I can make the change if you wish. |
Was thinking about that too, but since default options are 'right', I thought that the one who sets it to 'off' undestands that he hides pin icon even on combined bar. Also was thinking about making pin button 'off' not working on combined row by default, and adding a separate setting like 'hide pin icon if its option is set to off, even when pinned tabs are on one row with regular tabs'. But this would add disambiguity to
I have tested your change, I like how it works. Solves my issue, and adds even more flexibility.
True, the number of people willing to use it is most likely too small.
Something like that I thought when saw the code to edit. There should be general functionality over both actions. But one of questions about that is, should the tab action be single? Will there be other actions for tabs in the future, where more than one should be displayed and controlled separately? Yeah I can try to implement this. |
src/vs/workbench/browser/parts/editor/multiEditorTabsControl.ts
Outdated
Show resolved
Hide resolved
src/vs/workbench/browser/parts/editor/multiEditorTabsControl.ts
Outdated
Show resolved
Hide resolved
Made the changes. Second commit (Mount...) is about generalizing things for tab actions by making TabAction class for it. May need renaming etc. Maybe it is possible to get options object without passing it to Visibility method? I'm not familiar with the code to figure it out on my own. Can be reverted if not needed. Another thing I thought is - what if someone wants to have close buttons on regular tabs, but no close buttons on pinned ones? Having no close button on them kinda protects them a bit from accident closing by missclicks. This may still force us to add another setting for that if there is no better ideas. |
There is an idea to avoid adding a separate setting for this - make the visibility settings as follows, instead of boolean ones: |
To be more correct.
|
I did a bit of refactoring and added settings migration which makes sure that users which used the old setting get the correct new settings. Otherwise it looks great. I think the way it works now is simple enough for everyone to understand and solves all the problems that users want to fix. We have one month before this will be released to stable, giving us enough time to see what people think about it. |
Adds a setting to control pinned tab button:
workbench.editor.pinnedTabButton = 'left' | 'right' | 'off'
Which works the same way as
workbench.editor.tabCloseButton = 'left' | 'right' | 'off'
doesCurrent behavior
When the tab is pinned, its close button gets replaced with pin icon button, and
workbench.editor.tabCloseButton
partially loses its functionality over it (it still controls button left/right position, but 'off' option is not applied).Why was this necessary
Since now we have ability to display pinned tabs on a separate row by using
workbench.editor.pinnedTabsOnSeparateRow
, I missed the opportunity to hide pin icon to make the tabs from both rows aligned to each other:How it can be used
workbench.editor.tabSizing = fixed
is not as good due to various or short name lengths.a) In my case, the pinned files contain the code of the base classes, and on second row are the files from different folders, containing classes inherited from pinned ones. It’s very convenient if the corresponding tabs are located strictly above each other.
b) You may be working on a set of a files with different versions.
Additional info for reviewing the change.
workbench.editor.pinnedTabSizing = 'normal'
. I think I have played enough with different setups, but may need fresh view.Settings combinations I have been testing are from:
window.density.editorTabHeight
workbench.editor.pinnedTabsOnSeparateRow
workbench.editor.tabSizing
workbench.editor.pinnedTabSizing
workbench.editor.tabCloseButton
workbench.editor.pinnedTabButton
Any other settings I need to test on?
workbench.editor.tabCloseButton
.