microsoft / vscode

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

Enable secondary sidebar by default #191202

Open JBurlison opened 1 year ago

JBurlison commented 1 year ago

As of right now every time you open a new project, you need to go to View->Appearance->Secondary Side Bar to view the second side bar. As someone who uses VS Code for opening a lot of projects and directories, this is a big pain to have to repeat this process every time I open a new project. Once you enable the second side bar for a project it re-opens fine when you re-open the project. The specific feature request here is that I can have the second side bar open by default all the time. I use the secondary side bar as my file explorer and this would be very useful.

Thanks!

VSCodeTriageBot commented 1 year ago

This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

danielvanmil commented 1 year ago

+1

starball5 commented 1 year ago

Related on Stack Overflow: Open secondary side bar on startup vscode.

JBurlison commented 1 year ago

Related on Stack Overflow: Open secondary side bar on startup vscode.

Alternatively, it could just be that the secondary sidebar's open-ness be remembered and restored on startup, which I think is how the panel works.

Yes I did mention in my post I use this. The issue is with NEW projects/folders

tomaszs commented 1 year ago

Related: Also Output window (bottom bar) could be a subject to default behavior. It's surprising it's not handled by default. Just add two properties to the configuration of VSCode.

VSCodeTriageBot commented 11 months ago

:slightly_smiling_face: This feature request received a sufficient number of community upvotes and we moved it to our backlog. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

lobsterkatie commented 11 months ago

Also Output window (bottom bar) could be a subject to default behavior

Or the terminal.

It would be great if there were settings like

secondarySidebarDefaultView: [closed/outline/openEditors/whatever tabs live there]
bottomPanelDefaultView: [closed/problems/output/terminal/whatever tabs live there]
andrezzasouza commented 10 months ago

I've found a temporary fix for this problem. It might help someone else out there. I'm using the Secondary Side Bar to view the Outline of the files I'm on. As it was annoying to always have to manually open it, I used VS Code Tasks to automate it.

In order to that, I used the Ctrl+Shift+P shortcut to bring up the Command Palette. I typed "Open User Tasks" in the Command Palette and clicked on the option that appears there with this name. By clicking on this option, a file names tasks.json opens up. You can configure tasks using this file. I edited the file so it contained the code below:

{
  // See https://go.microsoft.com/fwlink/?LinkId=733558
  // for the documentation about the tasks.json format
  "version": "2.0.0",
  "tasks": [
    {
      "label": "Open Secondary Side Bar after opening a folder",
      "type": "shell",
      "command": "${command:outline.focus}",
      "runOptions": {
        "runOn": "folderOpen"
      }
    },
    {
      "label": "Open Secondary Side Bar on Startup",
      "type": "shell",
      "command": "${command:outline.focus}"
    }
  ]
}

Now the Side Bar opens on its own and shows the Outline both on startup and when I open a new folder. Hope it helps who's having the same problem I was having with the side bar while we wait for an official solution. 😊

starball5 commented 10 months ago

@andrezzasouza huh. interesting usage of tasks. I don't think your Open Secondary Side Bar on Startup task works... actually, your Open Secondary Side Bar after opening a folder task doesn't work for me either when I open a workspace folder. What version of VS Code are you running on, and on what platform?

andrezzasouza commented 10 months ago

@starball5 I did some testing here and I think I understand what's happening.

Before I configured the task, I had already moved the Outline menu to the Secondary Side Bar. For this reason, the command the task runs ("${command:outline.focus}") works for me. It's just opening the Outline menu, which was last positioned on the Secondary Side Bar and reopens there by default afterwards. If I move the Outline menu back to the Primary Side Bar, it doesn't work on my computer either.

I did some research and now I can open the Secondary Side Bar on startup and when a new folder is opened whether something is already there, such as the Outline menu, or not. This is the configuration for the tasks.json file that I used to achieve this:

{
  "version": "2.0.0",
  "tasks": [
    {
      "label": "Open Secondary Side Bar after opening a folder",
      "command": "${command:workbench.action.focusAuxiliaryBar}",
      "runOptions": {
        "runOn": "folderOpen"
      }
    },
  ]
}

For reference, I'm using Elementary OS 6.1 and VS Code 1.84.1 for Linux. Here's how it looks like: SecondarySideBar

I hope this configuration works for you! 😊

LukeDickerson19 commented 10 months ago

holy shit what vs code theme are you using? @andrezzasouza

andrezzasouza commented 10 months ago

Hey, @LukeDickerson19! It's amazing, isn't it?! 😍 It's called Purple Night.

lobsterkatie commented 9 months ago

@andrezzasouza - Clever! But I don't think it's an option for those of us who work on shared repos. tasks.json lives in the repo's .vscode directory and unless that's ,gitignored, there'd be no way to have this (which is a personal preference) not apply to everyone working on the repo.

starball5 commented 9 months ago

@andrezzasouza - Clever! But I don't think it's an option for those of us who work on shared repos. tasks.json lives in the repo's .vscode directory and unless that's ,gitignored, there'd be no way to have this (which is a personal preference) not apply to everyone working on the repo.

@lobsterkatie Read very carefully. I repeat for them:

I typed "Open User Tasks" in the Command Palette

cyanff commented 7 months ago

  "version": "2.0.0",
  "tasks": [
    {
      "label": "Open Secondary Side Bar after opening a folder",
      "command": "${command:workbench.action.focusAuxiliaryBar}",
      "runOptions": {
        "runOn": "folderOpen"
      }
    },
  ]
}```

This is great, thanks!

I had an issue where upon opening folders with the secondary side bar (auxiliary bar) already open, the script would close it. I changed toggleAuxiliaryBar to focusAuxiliaryBar instead so that this wouldn't happen

{
    "label": "Open secondary sidebar on folder open",
    "command": "${command:workbench.action.focusAuxiliaryBar}",
    "runOptions": {
      "runOn": "folderOpen"
    },
    "hide": true,
}
lzhprigrammer commented 4 months ago

So is this feature currently implemented?

alexander-kastil commented 2 months ago

I would also urgently need this feature ... have the github copilot running there so it does not hide my (solution) explorer. undocking is not an option because some "chat" commands the would again use the standard chat window in the primary sidebar

Saya47 commented 1 month ago

There's no secondary side bar on the when clause https://code.visualstudio.com/api/references/when-clause-contexts

MudDev commented 2 weeks ago

For context of how I use the secondary sidebar, I use the secondary sidebar to view a list of opened files for a vertical view and I hide the horizontal open files view.

This solution works but would love an official support.

HEROgold commented 2 weeks ago

Recently been using the secondary sidebar for Outline and file history. Especially on my desktop it's useful since a lot of text/code doesn't even get close to the right side of my screen, so i place my sidebar there.

Works great, but having to run a command each time i open anything besides a previous project is just tedious. I'd love official support, already seems like it tracks its state on projects, i'd be amazing per profile/user.