microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.27k stars 29.31k forks source link

Add Setting to hide Unpin Action #196972

Closed benibenj closed 1 year ago

benibenj commented 1 year ago

When using workbench.editor.pinnedTabsOnSeparateRow user might not want to have the unpin action but the close action. We considered not showing the unpin action when using the pinned tab row by default without adding a setting, however, in the case when the user only has pinned tabs there is only one row and it can be unclear if all tabs are pinned or unpinned. Users might also not want to see the unpin action when using a single tab row, so it make sense to add a setting. My suggestion is to have the following settings:

tabActionLocation defines the location of the actions on the tab. If a tab is pinned and tabActionUnpinVisibility is set to false, we show the close action as long as tabActionCloseVisibility is set to true, otherwise we don't show it.

Thanks to @n-gist for suggesting a similar approach and creating a PR for it: #196896

benibenj commented 11 months ago

Verification steps:

Set workbench.editor.showTabs: multiple

  1. Pin some tabs (with right click or command)
  2. Change tabActionLocation from right to left: unpin and close actions on the tab should move to the left of the file name
  3. Disable tabActionUnpinVisibility setting, the unpin action on pinned tabs do not show anymore. The close action shows instead (on hover)
  4. Disable tabActionCloseVisibility setting, the close actions does not show anymore on the tabs.