Skip to content

Add option to hide title bar in Zen Mode (even outside full screen mode) - #117149

Closed
Alex Hirsch (W4RH4WK) wants to merge 1 commit into
microsoft:mainfrom
W4RH4WK:w4rh4wk/hide-title-bar-zen-mode
Closed

Alex Hirsch (W4RH4WK) wants to merge 1 commit into
microsoft:mainfrom
W4RH4WK:w4rh4wk/hide-title-bar-zen-mode

Conversation

@W4RH4WK

Copy link
Copy Markdown
Contributor

This adds a new option zenMode.hideTitleBar to hide the title bar in Zen Mode, even when not in full screen mode.

It works fine when window.menuBarVisibility set to toggle, but currently not for classic. This happens because the menu bar focus / unfocus logic cannot query whether Zen Mode is currently active or not.

} else if (this.options.visibility === 'classic' && browser.isFullscreen()) {

Furthermore, during debugging I discovered that some functions in layout.ts related to the menu bar might be dead code, namely getMenubarVisibility and toggleMenuBar.

This PR is related to #33607, #115570, #117136.

This adds a new option `zenMode.hideTitleBar` to hide the title bar in
Zen Mode, even when not in full screen mode.

Currently this requires `window.menuBarVisibility` to be set to
`toggle`. This comes from the issue that the menu bar focus / unfocus
logic has no access to the Zen Mode active flag. Querying this flag is
required to correctly make this work for `window.menuBarVisibility ==
'classic'`.
@isidorn

Copy link
Copy Markdown

Thanks you for this PR.
This week we are in endgame week which means we are focused on shipping the next vscode stable version and we only take fixes in.
Thus I will only review this next week and then I can provide more feedback.

wasPanelVisible: false,
transitionDisposables: new DisposableStore(),
setNotificationsFilter: false,
alwaysHideTitleBar: false,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer if this was not a boolean but that it actualy held a value of the setting

@isidorn

Copy link
Copy Markdown

I have looked into this, some thoughts:

  1. toggleMenuBar and getMenubarVisibility is not dead code since it is used from ToggleMenuBarAction from layoutActions.ts. Or am I missing something?
  2. window.menuBarVisibility is a setting only on Linux and Windows, thus the comment for your setting does not make sense for mac.

This PR would ideally fix #44593

I am not 100% convinced we need this. What is the biggest benefit of adding this setting?

@eimfach

Robin Gruenke (eimfach) commented Mar 2, 2021 •

Copy link
Copy Markdown

I am not 100% convinced we need this. What is the biggest benefit of adding this setting?

I think it is same question of why we need zen mode.... For the zen that is ;)

Besides that it allows users to keep being undistracted by the user interface (some users are, including myself). If you only want to see code, you really want to only see just the code.

Edit: I also think it is a accessibility feature for people with ADHD or similiar

Edit:
Also it allows the user to have freedom of choice regarding their experience of zen mode (as opt in)

@W4RH4WK

Copy link
Copy Markdown
Contributor Author
  1. toggleMenuBar and getMenubarVisibility is not dead code since it is used from ToggleMenuBarAction from layoutActions.ts. Or am I missing something?

You are correct, I did not track the usage across interface boundaries. I was just a bit surprised that my breakpoint did not trigger while testing. So false alarm here.

  1. window.menuBarVisibility is a setting only on Linux and Windows, thus the comment for your setting does not make sense for mac.

Of course I could just add something like for linux and windows. But it would complicate the documentation even further. I don't own a mac device so I can't test the behavior. I'd expect the menu bar to be unaffected by this change.

I am not 100% convinced we need this. What is the biggest benefit of adding this setting?

I am also skeptical whether this is in a state where it should be merged. But maybe a step in the right direction.

#33607 requests a way to remove unnecessary clutter from the editor's top. I think this is a perfectly reasonable request. For many people it might be just aesthetical, others with low resolution screens might benefit from the additional space.

For me, personally (#115570), I'd just like to hide the title bar without needing to put the editor in full screen mode --- maximizing the vertical space while maintaining the width.

@isidorn

Copy link
Copy Markdown

#33607 is a different request - that one want to hide the editor Title area (breadcrumbs, tabs etc...). This PR is hiding the VS Code Title area. So unrelated.

So this PR only does the following:
If you are in zen mode and you do not want to be in full screen you can get the title bar hidden.

So not convinced yet.

@W4RH4WK

Copy link
Copy Markdown
Contributor Author

Alright. Do I understand #44593 correctly, that this PR implements the wanted functionality, but ties it to Zen mode instead of centered mode? Or am I missing something?

@isidorn

Copy link
Copy Markdown

This PR hides the VS Code top level title bar.
That Issue wants to hide the Editor title bar -> place where we show breakpoints. Read that issue, there should be pictures

@W4RH4WK

Alex Hirsch (W4RH4WK) commented Mar 3, 2021 •

Copy link
Copy Markdown
Contributor Author

I understand, thanks for clarifying. But this means #115570 is not a dup (?).

@isidorn

Copy link
Copy Markdown

Yeah it is not a dup. But still not convinced we need it. though I can reopen if you would like

@W4RH4WK

Copy link
Copy Markdown
Contributor Author

No need, but thanks. Let's see what other solutions come up in the future. I suspect there are quite a few people who'd like an option to cut down on the wasted vertical space in- and outside of Zen mode.

@isidorn

Copy link
Copy Markdown

No plans to merge at the moment, thus closing. Thanks anyways for your PR and I am sorry that we were unable to merge this.

@github-actions github-actions Bot locked and limited conversation to collaborators Oct 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

workbench-zen Full screen 'Zen' view issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants