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

Add setting to automatically hide the side bar #3742

Open
Nimzozo opened this issue Mar 5, 2016 · 101 comments
Open

Add setting to automatically hide the side bar #3742

Nimzozo opened this issue Mar 5, 2016 · 101 comments
Assignees
Labels
feature-request Request for new features or functionality layout General VS Code workbench layout issues ux User experience issues
Milestone

Comments

@Nimzozo
Copy link

Nimzozo commented Mar 5, 2016

Would it be possible to add a option to automatically hide the files explorer after a configurable duration ?

@isidorn isidorn added the feature-request Request for new features or functionality label Mar 7, 2016
@isidorn
Copy link
Contributor

isidorn commented Mar 7, 2016

ping @bpasero

@bpasero bpasero changed the title Automatically hide the files explorer Add setting to automatically hide the files explorer Mar 7, 2016
@bpasero bpasero added the file-explorer Explorer widget issues label Mar 7, 2016
@bpasero bpasero added this to the Backlog milestone Mar 7, 2016
@bpasero
Copy link
Member

bpasero commented Mar 7, 2016

Honestly this seems like a weird setting. There is a keyboard shortcut to just hide the explorer (Cmd+B).

@Tyriar
Copy link
Member

Tyriar commented Mar 7, 2016

@bpasero seems reasonable, auto-hide similar to how the taskbar in all major OS' can be setup to hide and display when you hover over the edge?

@bpasero
Copy link
Member

bpasero commented Mar 7, 2016

@Tyriar that makes a lot more sense to me compared to having a fixed timeout :)

@bpasero
Copy link
Member

bpasero commented Mar 7, 2016

Even more interesting would be in that mode to maybe not push the editor to the right, but rather overlay the contents, since it is getting dismissed quickly after when moving focus out.

@Nimzozo
Copy link
Author

Nimzozo commented Mar 7, 2016

That's right. Maybe I have badly explained.

@bpasero bpasero self-assigned this Mar 30, 2016
@bpasero bpasero changed the title Add setting to automatically hide the files explorer Add setting to automatically hide the side bar Jul 5, 2016
@lllopo
Copy link

lllopo commented Jul 5, 2016

Visual Studio panels 'auto-hide' : you click on it - it shows, you click outside - it goes is pretty neat and more than enough. As of 'push editor to the right' - this more a separate option to 'dock' the panels or not. Would be also nice to have, though.

@bgashler1 bgashler1 added the ux User experience issues label Jul 5, 2016
@bpasero bpasero removed their assignment Aug 17, 2016
@volkanunsal
Copy link

This would be super useful. It would also be neat to hide the sidebar entirely. The big icons are simply too distracting. I never use the debugger, and never use Git from the sidebar, and the search icon isn't very useful either.

@Tyriar
Copy link
Member

Tyriar commented Oct 26, 2016

@volkanunsal that's the "activity bar" with the icons, this one is relevant for what you want #1105

@Venryx
Copy link

Venryx commented Mar 8, 2017

I'd prefer this way as well, having it auto-hide when the user clicks outside of the sidebar.

Visual Studio allows this approach, and it's really convenient as it lets me have many different types of panels easily accessible, without cutting out from the main text editor size. (most of the time, you only need a panel open very briefly to change or check something, then you jump back into the code and don't need it on-screen any more)

It would also be nice to let extensions add their own panels to the activity/sidebar, as in Visual Studio --
although that's another subject.

@Venryx
Copy link

Venryx commented Mar 8, 2017

Went ahead and made an extension for this: https://marketplace.visualstudio.com/items?itemName=venryx.vscode-vtools

It's not perfect -- it only closes the side-bar when the user changes the selection (eg, clicking or dragging at a new location) -- but it achieves the basic function.

Built-in support is still ideal, but this should help until then.

@richrundmsft
Copy link
Member

Always having explorer open seems such a waste of space -- I want the focus to be on the document I'm working on, but by default 20% of my screen is taken up by Explorer.

The ctrl/cmd + B option to show/hide isn't very discoverable - my first instinct was to try and use View -> Explorer [ctrl/cmd + shift + E] to be a toggle (but it isn't).
I ended up doing a web search to find out how to hide the panel (and ended up on this thread)

@sjy
Copy link

sjy commented Jul 18, 2017

Perhaps VS code should be available to be customized to auto-hide side bar just like the bahavior of Dock in Mac

@Samic8
Copy link

Samic8 commented Aug 10, 2017

I would really like this feature. I find having the sidebar open distracting, but often I forget to close. Same goes for the terminal

@reynoldsbd3
Copy link

I would also love to see Visual Studio's "auto hide when focus changes" behavior implemented here.

@zer09
Copy link

zer09 commented Nov 13, 2017

Also a suggestion, that it should look like a floating panel, so it wont resize the document page width when it shows or hide.

@wowczarczyk
Copy link

This would be particularly helpful with Source Control view occupying the sidebar content. I like it to be quite wide to see the full branch name etc. but then it leaves little room for the file content on the right. Auto-hiding would solve that nicely!

@chanced
Copy link

chanced commented Dec 30, 2022

I'd love to be able to hide it based on an action, e.g. opening a file.

edit: This is possible with a shortcut + an extension: (multi-command):

	{
		"key": "o",
		"command": "extension.multiCommand.execute",
		"args": {
			"sequence": [
				"explorer.openAndPassFocus",
				"workbench.action.toggleSidebarVisibility",
			]
		},
		"when": "!inputFocus && filesExplorerFocus"
	},

@espipj
Copy link

espipj commented Feb 1, 2023

Hey! What's the status of this issue? It's been in the backlog for almost 7 years now 🤔 cc/ @bpasero

@jeandat
Copy link

jeandat commented Feb 1, 2023

When in zen mode, it would also be very pleasant. Just reaching the edge of the screen would show the corresponding sidebar. You can focus on code and see extra informations like the files list or the outline right when you need it. Very clean IMO.

You will need to provide a configurable threshold for the edge cause distinct use cases might need different values. For instance if your code occupy the whole width you want a very small threshold. Maybe even 0. But if you are in zen mode and you have extra space on the left and the right, maybe you want to show the sidebar very soon like at 100px or 200px of the edge.

You may want one sidebar to act that way and another to be always visible. It is probably better to make that mode an option of the sidebar.

In general, I like vscode but it lacks personalisation in that domain. I would love being able to detach the terminal too (whether I have 2 screens or not). That's the same need at heart: being able to adapt vscode to your configuration (space, number of screens, personal workflow, etc.).

@SkyaTura
Copy link

SkyaTura commented Feb 11, 2023

Hey! What's the status of this issue? It's been in the backlog for almost 7 years now 🤔 cc/ @bpasero

The status is: they don't care 🥲


Maybe if someone propose something they can label as a "fancy AI feature" it get some attention...

@mrhammadasif
Copy link

Is there any PR already attached for this feature, else I would be happy to create a PR (would need some guidance though).

Would the members of VSCode need this feature to be done or this feature request would be stranded like numerous feature requests?

@l-cornelius-dol
Copy link

l-cornelius-dol commented Mar 11, 2023

I too would love to see this feature; the offered extensions are limited, primarily because they hide on click instead of on editor focus and I don't like using my mouse while programming, preferring keyboard shortcuts.

It should be noted this is not just for small screens. I have a 55" monitor, but I use only a section of it for code editing, with the space around the editor for other windows. So I edit in a 1800x1400 window despite having a large 4K monitor.

@SkyaTura : I don't think it's because "they" don't care -- when there's lots to do things get overlooked, even very useful things. Personally, I think it's a little on the arrogant side to whine about software you are getting for free, even more so if you are a developer yourself and should therefore understand the demands made on a devs time and should appreciate volunteer efforts and/or a company's donations of human resources.

@SkyaTura
Copy link

I understand your point, sorry if what I said war offensive in any way to anyone who has even once been related to this project.

I do understand the collective effort made to get to the product we have today, and I appreciate all teams involved in that, however, I also understand that VSCode is not an independent project maintained by a couple people living in there basements... It's not only an open project, but a full product of one of the biggest tech industries in the planet, and also rentable somehow.

There will be decision-making based on money and marketing, and a feature like this, no matter how important would be for us, if it's not relevant in this parameters, will never be priority. (unless, maybe, if a blessed soul decides to try submitting a PR)

Well, I feel that this may sound arrogant again, so I want to explicit that I'm just trying to be realistic and sometimes I don't know the right words to argument, but I honestly understood what you meant. I'm sorry in advance if that is the case on this message again, but I won't argue again because I don't want to diverge the focus on the issue subject.

@rbreaves
Copy link

rbreaves commented May 6, 2023

I have a solution for this via autohotkey, I still like the auto hide sidebar extension as well, at least for the left sidebar, doesn't support others.

I have mapped hotkeys to map to alt-[, alt-] and alt-' that are associated w/ the left, right sidebars and the tab bar area.

toggleSidebars.ahk

#IfWinActive, ahk_exe Code.exe
Loop {
  CoordMode, Mouse, Screen
  MouseGetPos, xpos, ypos
  If (xpos = 0) {
    Send, ![
    Sleep, 100
    MouseGetPos, xpos, ypos
    While (xpos = 0) {
      Sleep, 100
      MouseGetPos, xpos, ypos
    }
  }
  If (xpos = A_ScreenWidth-1) {
    Send, !]
    Sleep, 100
    MouseGetPos, xpos, ypos
    While (xpos = A_ScreenWidth-1) {
      Sleep, 100
      MouseGetPos, xpos, ypos
    }
  }
  If (ypos = 0) {
    Send, !'
    Sleep, 100
    MouseGetPos, xpos, ypos
    While (ypos = 0) {
      Sleep, 100
      MouseGetPos, xpos, ypos
    }
  }
  Sleep, 100
}
#IfWinActive

keybindings.json

    {
        "key": "alt+'",
        "command": "workbench.action.toggleTabsVisibility"
    },
    {
        "key": "alt+[",
        "command": "workbench.action.toggleSidebarVisibility"
    },
    {
        "key": "alt+]",
        "command": "workbench.action.toggleAuxiliaryBar"
    },

@SkyaTura
Copy link

SkyaTura commented May 6, 2023

I got my workaround by using BetterTouchTool triggers on mac. Still miss a integrated solution tho

@rbreaves
Copy link

rbreaves commented May 6, 2023

I got my workaround by using BetterTouchTool triggers on mac. Still miss a integrated solution tho

Yea, I am about to work something out for Linux as well when using freerdp as the mouse doesn't always rest where it needs to, but on macOS & jump desktop it does seem to work even if the mouse exits outside of the window. But yea I use BetterTouchTool as well on macOS when I need to.

I think on linux the easiest solution will be to use devilspie2 and a lua based script, secondarily autokey or bash with xbindkeys and xdotool, but hoping that devilspie2 is good enough to handle it.

@rbreaves
Copy link

rbreaves commented May 6, 2023

A follow up solution for Linux distros running under X11, not wayland. Just make sure to set your hotkeys to match in vscode.

Vi ~/sidetriggers.sh (then chmod +x the file & run it)

#!/bin/bash

# Define function to check if Code or xfreerdp app has focus
function work_has_focus() {
   local wm_class=$(xprop -id $(xdotool getactivewindow) WM_CLASS | awk -F'[",]+' '/WM_CLASS/{print $4}')
   if [[ $wm_class == "Code" ]] || [[ $wm_class == "xfreerdp" ]]; then
      return 0
   else
      return 1
   fi
}

# Define function to check if mouse is at left edge of screen
function mouse_at_left_edge() {
   local x=$(xdotool getmouselocation --shell | grep 'X=' | sed 's/X=//')
   (( x <= 1 ))
}

# Define function to check if mouse is at top edge of screen
function mouse_at_top_edge() {
   local y=$(xdotool getmouselocation --shell | grep 'Y=' | sed 's/Y=//')
   (( y <= 1 ))
}

# Define function to check if mouse is at right edge of screen
function mouse_at_right_edge() {
   local x=$(xdotool getmouselocation --shell | grep 'X=' | sed 's/X=//')
   local max_x=$(xrandr --current | grep '*' | awk '{print $1}' | cut -d 'x' -f 1)
   #echo "x=$x, max_x=$max_x"
   (( x >= max_x - 1 ))
}

# Define function to handle hotkey
function handle_hotkey() {
   xdotool keyup Alt_L keydown Alt_L key $1 keyup Alt_L
}

# Define state variables for hotkey trigger
left_edge_triggered=false
top_edge_triggered=false
right_edge_triggered=false

# Loop indefinitely
while true; do
   if work_has_focus && mouse_at_left_edge; then
      if ! $left_edge_triggered; then
         handle_hotkey "bracketleft"
         left_edge_triggered=true
      fi
   else
      left_edge_triggered=false
   fi

   if work_has_focus && mouse_at_top_edge; then
      if ! $top_edge_triggered; then
         handle_hotkey "apostrophe"
         top_edge_triggered=true
      fi
   else
      top_edge_triggered=false
   fi

   if work_has_focus && mouse_at_right_edge; then
      if ! $right_edge_triggered; then
         handle_hotkey "bracketright"
         right_edge_triggered=true
      fi
   else
      right_edge_triggered=false
   fi

   sleep 0.1
done

@tgienger
Copy link

Honestly this seems like a weird setting. There is a keyboard shortcut to just hide the explorer (Cmd+B).

hotkey to open the sidebar, key down to the file you want to open, hit enter, file opens, sidebar closes.

why would I want to waste another action to close it again?

@optimbro
Copy link

Is there any progress on this? Keeping the file explorer open while editing code is a waste of real estate. It also affects my focus.

Can someone share a working extension for the time being, I tried this: Auto Toggle Sidebar, but it didn't seem to work.

@Venryx
Copy link

Venryx commented Sep 13, 2023

Can someone share a working extension for the time being, I tried this: Auto Toggle Sidebar, but it didn't seem to work.

This is the one I use: https://marketplace.visualstudio.com/items?itemName=sirmspencer.vscode-autohide

It's an extended version (by someone else) of an extension I had made a long time ago for it. (which I think I linked to years ago in this thread haha)

@optimbro
Copy link

Can someone share a working extension for the time being, I tried this: Auto Toggle Sidebar, but it didn't seem to work.

This is the one I use: https://marketplace.visualstudio.com/items?itemName=sirmspencer.vscode-autohide

It's an extended version (by someone else) of an extension I had made a long time ago for it. (which I think I linked to years ago in this thread haha)

Hehe, nice, Thanks @Venryx . It worked like a charm, also I have more real estate now. Thanks @sirmspencer

Share before, and after results:

Before

image

After

image

I hope Microsoft can fix this with the help of their AIs, if not possible by DEVs 👏

@IF-Adin
Copy link

IF-Adin commented Sep 13, 2023

@optimbro How and why exactly should an AI be used for something that is obviously already done and only needs implementation?

@optimbro
Copy link

@optimbro How and why exactly should an AI be used for something that is obviously already done and only needs implementation?

"Implementation" is the issue; it has not been implemented. It's already been more than 7 years. Maybe AI can help here? How? If I knew I could just send a pull request.

@LordKayBanks
Copy link

It would be great if one could just hover on the retracted sidebar to fully reveal it.

@brunodantas
Copy link

brunodantas commented Oct 13, 2023

Looking for an auto-hide like in the Arc Browser or the Mac Dock...

@Aitor-EVSA
Copy link

Autohide (or show on hover) for the Sidebar + Activity bar would be amazing for us with vertical monitors.

@HugoSbl
Copy link

HugoSbl commented Feb 9, 2024

I defenitly agree on that. Sidebar needs to not only hide, but appear on mouse hover, and disapear when whe mouse is anywhere else than over it.
Also, would be perfect if it would not push the editors panel to the right. It should be floating in front of your code, appearing as soon as the mouse touch the left of the screen/app, and disapearing as soon as the mouse goes.

It would be even more usefull on small screen or on the go.

Isn't there any extension that does this ?

@4itor
Copy link

4itor commented Feb 12, 2024

This is specially useful on vertical monitors, I don't think an extension will be able to do it as a "floating" bar, not pushing the editor panel to the right.

Current autohide extension (and forks) just toggle the visibility of the panel (usually same as doing it via hotkey).

You can search for "autohide" in extension marketplace to find them.

I would also love to be able to enable autohide mode if the window is taller than wide (vertical form factor).

A man can dream; (I guess the fact that is more than 7 years old and hasn't been closed yet gives me hope)

:-P

@optimbro
Copy link

I defenitly agree on that. Sidebar needs to not only hide, but appear on mouse hover, and disapear when whe mouse is anywhere else than over it. Also, would be perfect if it would not push the editors panel to the right. It should be floating in front of your code, appearing as soon as the mouse touch the left of the screen/app, and disapearing as soon as the mouse goes.

It would be even more usefull on small screen or on the go.

Isn't there any extension that does this ?

like they did on Edge browser, when you hover over copilot icon it does the same thing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality layout General VS Code workbench layout issues ux User experience issues
Projects
None yet
Development

No branches or pull requests