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

Command to make activityBar, menuBar, and statusbar visible (or invisible), or determine their current state, not just toggle #133787

Closed
dmalan opened this issue Sep 25, 2021 · 8 comments
Assignees
Labels
feature-request Request for new features or functionality layout General VS Code workbench layout issues
Milestone

Comments

@dmalan
Copy link

dmalan commented Sep 25, 2021

For educational use cases, we're hoping to configure students' workspaces (via Remote settings in Codespaces) to have a standard UI and also provide students with a command and button (via our own extension) via which they can restore their workspace's UI to that default state if they accidentally disable various UI elements while experimenting. At the moment, though, it seems that the visibility of the activityBar, menuBar, and statusbar can only be toggled, not explicitly set to visible or invisible. And there doesn't seem to be a way to inspect their current state, so as to know programmatically (when resetting the UI to a default state) whether or not to toggle them.

Might it be possible to supplement the commands below with commands like workbench.action.enable{ActivityBar,Statusbar,MenuBar} and workbench.action.disable{ActivityBar,Statusbar,MenuBar}?

  • workbench.action.toggleActivityBarVisibility
  • workbench.action.toggleStatusbarVisibility
  • workbench.action.toggleMenuBar

Thank you!

CC @rongxin-liu

@yume-chan
Copy link
Contributor

Those built-in commands just flip the corresponding settings:

  • workbench.activityBar.visible
  • workbench.statusBar.visible
  • window.menuBarVisibility

You can read/write these setting keys in your extension directly.

@sbatten
Copy link
Member

sbatten commented Sep 27, 2021

@yume-chan is correct that this can already be done in an extension via the settings

@sbatten sbatten closed this as completed Sep 27, 2021
@sbatten sbatten added the *extension-candidate Issue identified as good extension implementation label Sep 27, 2021
@rongxin-liu
Copy link

rongxin-liu commented Sep 27, 2021

Thank you! @yume-chan and @sbatten.

Is setting "window.menuBarVisbility" available currently? I'm getting this prompt when trying to use this setting:
Screen Shot 2021-09-27 at 14 55 31

@sbatten
Copy link
Member

sbatten commented Sep 28, 2021

@rongxin-liu it is only available as a user setting, not a workspace setting

@dmalan
Copy link
Author

dmalan commented Sep 29, 2021

Ah, thanks very much, @yume-chan, @sbatten. Just proposed window.menuBarVisbility as a potential Remote setting, too, in fact, #133786. Thank you!

@sana-ajani
Copy link
Contributor

sana-ajani commented Oct 6, 2021

Would it be possible to programmatically toggle specific views or items inside the activity bar, status bar, terminal? For instance, in the education use case, @dmalan has mentioned that they'd like to only show the Explorer view in the activity bar, or only show the Terminal view and hide the Problems, Output, etc.

So instead of just showing and hiding the whole bar, could we provide more control from the settings? Something like:

  "workbench.acivityBar.visible": {
      "fileExplorerView": true,
      "searchView": false,
      "extensionsView": false,
      "debugView": false,
      "sourceControlView": false,
  }

cc @sbatten

@sana-ajani sana-ajani reopened this Oct 6, 2021
@sbatten
Copy link
Member

sbatten commented Oct 6, 2021

That's not currently possible as the users preferences for this are stored in a separate state. Technically that data is sync'd with settings sync so it is export/importable, but we don't have a model today for sharing that state.

@sbatten sbatten assigned sana-ajani and unassigned sbatten Oct 9, 2021
@chrisdias chrisdias assigned chrisdias and unassigned chrisdias and sana-ajani Aug 8, 2022
@bpasero bpasero removed the *extension-candidate Issue identified as good extension implementation label Aug 9, 2022
@sbatten sbatten added feature-request Request for new features or functionality layout General VS Code workbench layout issues labels Dec 10, 2022
@sbatten sbatten added this to the Backlog milestone Dec 10, 2022
@chrisdias chrisdias assigned isidorn and unassigned chrisdias Dec 16, 2022
@isidorn
Copy link
Contributor

isidorn commented Dec 19, 2022

Closing this as there are already some solutions proposed in this issue, and we plan to introduce Profiles soon that will cover the remaining asks. Here's the issue tracking profiles #116740

@isidorn isidorn closed this as completed Dec 19, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Feb 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality layout General VS Code workbench layout issues
Projects
None yet
Development

No branches or pull requests

8 participants