Repository: jesseduffield/lazygit (language: go)

Issue:
Option to hide panels
**Is your feature request related to a problem? Please describe.**
The "Files - Submodules" panel is too small to see all the files that have changes.

**Describe the solution you'd like**
If I could hide the "Local Branches - Remotes - Tags" panel and/or the "Commits - Reflog" panel and/or the "Stash" panel, then the "Files - Submodules" panel could take up that extra space. I don't really ever use those bottom 3 panels, but I use the "Files" list a lot.

**Describe alternatives you've considered**
Maybe allow the panels to be resized, but that sounds more advanced and less helpful.

**Additional context**
There is already an option to hide the command log.

```yml
gui:
  showCommandLog: false
```

I just want a similar option for the other panels too.


Discussion / hints:
Try pressing `+` and `_` to switch screen modes to see if that helps.
A few things to try:
- press `+` to go into "half" screen mode (you'd have to do that every time you start lazygit, so maybe not ideal; also, it divides panel vs. diff view 50/50, maybe also not what you want. We have a PR to make this configurable, but it hasn't been reviewed by anybody yet: #3411)
- set the `gui.expandFocusedSidePanel` config to true. I like this a lot, it enlarges whatever panel has the focus; maybe that's already enough?
> Try pressing `+` and `_`

> Press `+` to go into "half" screen mode

Cool feature I didn't know about! This is sooo close to being what I want. In half screen mode, pressing <kbd>Enter</kbd> on a file hides the file list, which is not ideal. And having to press <kbd>+</kbd> to start every lazygit session isn't so good either.

> Set the `gui.expandFocusedSidePanel` config to true

This is great! Not sure where this came from, since it's not in [the docs](https://github.com/jesseduffield/lazygit/blob/master/docs/Config.md), but it does work. Only thing is it "expands" the panel to be ever so slightly larger than it used to be (34 lines in my case instead of the default 22 lines). Is there a way to make it expand even more? Not including the UI element lines with the borders, my default layout has 68 usable lines (1 in the Status panel, 22 in each of the other 3 panels, and 1 in the Stash panel). If all the non-active panels actually fully _collapsed_ instead of just shrinking a little, that would be neat.
> This is great! Not sure where this came from, since it's not in [the docs](https://github.com/jesseduffield/lazygit/blob/master/docs/Config.md), but it does work.

Oh wow. We recently switched to auto-generating the docs, and there's a pretty bad bug in there that omitted all boolean config keys. Here's a fix: #3622.

> Only thing is it "expands" the panel to be ever so slightly larger than it used to be (34 lines in my case instead of the default 22 lines). Is there a way to make it expand even more?

I think currently it expands it to make it twice as high as the others. I guess we could make this configurable somehow; I would also like it if it could be taller (maybe, not sure yet 😄). If you want to experiment with this yourself, the code is [here](https://github.com/jesseduffield/lazygit/blob/7492521829114b935c91a4eab856a554160122bd/pkg/gui/controllers/helpers/window_arrangement_helper.go#L441).

Fix patch:
diff --git a/docs/Config.md b/docs/Config.md
index b14ee993ae0..5662a4d7378 100644
--- a/docs/Config.md
+++ b/docs/Config.md
@@ -68,6 +68,10 @@ gui:
   # If true, increase the height of the focused side window; creating an accordion effect.
   expandFocusedSidePanel: false
 
+  # The weight of the expanded side panel, relative to the other panels. 2 means
+  # twice as tall as the other panels. Only relevant if `expandFocusedSidePanel` is true.
+  expandedSidePanelWeight: 2
+
   # Sometimes the main window is split in two (e.g. when the selected file has both staged and unstaged changes). This setting controls how the two sections are split.
   # Options are:
   # - 'horizontal': split the window horizontally
diff --git a/pkg/config/user_config.go b/pkg/config/user_config.go
index a5f65165d7b..41d3dfe1072 100644
--- a/pkg/config/user_config.go
+++ b/pkg/config/user_config.go
@@ -77,6 +77,9 @@ type GuiConfig struct {
 	SidePanelWidth float64 `yaml:"sidePanelWidth" jsonschema:"maximum=1,minimum=0"`
 	// If true, increase the height of the focused side window; creating an accordion effect.
 	ExpandFocusedSidePanel bool `yaml:"expandFocusedSidePanel"`
+	// The weight of the expanded side panel, relative to the other panels. 2 means
+	// twice as tall as the other panels. Only relevant if `expandFocusedSidePanel` is true.
+	ExpandedSidePanelWeight int `yaml:"expandedSidePanelWeight"`
 	// Sometimes the main window is split in two (e.g. when the selected file has both staged and unstaged changes). This setting controls how the two sections are split.
 	// Options are:
 	// - 'horizontal': split the window horizontally
@@ -651,6 +654,7 @@ func GetDefaultConfig() *UserConfig {
 			SkipStashWarning:         false,
 			SidePanelWidth:           0.3333,
 			ExpandFocusedSidePanel:   false,
+			ExpandedSidePanelWeight:  2,
 			MainPanelSplitMode:       "flexible",
 			EnlargedSideViewLocation: "left",
 			Language:                 "auto",
diff --git a/pkg/gui/controllers/helpers/window_arrangement_helper.go b/pkg/gui/controllers/helpers/window_arrangement_helper.go
index 8615769dc1b..5c17083f7f4 100644
--- a/pkg/gui/controllers/helpers/window_arrangement_helper.go
+++ b/pkg/gui/controllers/helpers/window_arrangement_helper.go
@@ -443,7 +443,7 @@ func sidePanelChildren(args WindowArrangementArgs) func(width int, height int) [
 				if accordionMode && defaultBox.Window == args.CurrentSideWindow {
 					return &boxlayout.Box{
 						Window: defaultBox.Window,
-						Weight: 2,
+						Weight: args.UserConfig.Gui.ExpandedSidePanelWeight,
 					}
 				}
 
diff --git a/schema/config.json b/schema/config.json
index a5c704db0cb..f5f7bab86ef 100644
--- a/schema/config.json
+++ b/schema/config.json
@@ -76,6 +76,11 @@
           "description": "If true, increase the height of the focused side window; creating an accordion effect.",
           "default": false
         },
+        "expandedSidePanelWeight": {
+          "type": "integer",
+          "description": "The weight of the expanded side panel, relative to the other panels. 2 means\ntwice as tall as the other panels. Only relevant if `expandFocusedSidePanel` is true.",
+          "default": 2
+        },
         "mainPanelSplitMode": {
           "type": "string",
           "enum": [


Test patch:
diff --git a/pkg/gui/controllers/helpers/window_arrangement_helper_test.go b/pkg/gui/controllers/helpers/window_arrangement_helper_test.go
index 9c455ff331d..b429e00ae42 100644
--- a/pkg/gui/controllers/helpers/window_arrangement_helper_test.go
+++ b/pkg/gui/controllers/helpers/window_arrangement_helper_test.go
@@ -121,6 +121,87 @@ func TestGetWindowDimensions(t *testing.T) {
 			B: information
 			`,
 		},
+		{
+			name: "expandFocusedSidePanel",
+			mutateArgs: func(args *WindowArrangementArgs) {
+				args.UserConfig.Gui.ExpandFocusedSidePanel = true
+			},
+			expected: `
+			╭status─────────────────╮╭main────────────────────────────────────────────╮
+			│                       ││                                                │
+			╰───────────────────────╯│                                                │
+			╭files──────────────────╮│                                                │
+			│                       ││                                                │
+			│                       ││                                                │
+			│                       ││                                                │
+			│                       ││                                                │
+			│                       ││                                                │
+			│                       ││                                                │
+			│                       ││                                                │
+			│                       ││                                                │
+			│                       ││                                                │
+			╰───────────────────────╯│                                                │
+			╭branches───────────────╮│                                                │
+			│                       ││                                                │
+			│                       ││                                                │
+			│                       ││                                                │
+			│                       ││                                                │
+			╰───────────────────────╯│                                                │
+			╭commits────────────────╮│                                                │
+			│                       ││                                                │
+			│                       ││                                                │
+			│                       ││                                                │
+			│                       ││                                                │
+			╰───────────────────────╯│                                                │
+			╭stash──────────────────╮│                                                │
+			│                       ││                                                │
+			╰───────────────────────╯╰────────────────────────────────────────────────╯
+			<options──────────────────────────────────────────────────────>A<B────────>
+			A: statusSpacer1
+			B: information
+			`,
+		},
+		{
+			name: "expandSidePanelWeight",
+			mutateArgs: func(args *WindowArrangementArgs) {
+				args.UserConfig.Gui.ExpandFocusedSidePanel = true
+				args.UserConfig.Gui.ExpandedSidePanelWeight = 4
+			},
+			expected: `
+			╭status─────────────────╮╭main────────────────────────────────────────────╮
+			│                       ││                                                │
+			╰───────────────────────╯│                                                │
+			╭files──────────────────╮│                                                │
+			│                       ││                                                │
+			│                       ││                                                │
+			│                       ││                                                │
+			│                       ││                                                │
+			│                       ││                                                │
+			│                       ││                                                │
+			│                       ││                                                │
+			│                       ││                                                │
+			│                       ││                                                │
+			│                       ││                                                │
+			│                       ││                                                │
+			│                       ││                                                │
+			│                       ││                                                │
+			╰───────────────────────╯│                                                │
+			╭branches───────────────╮│                                                │
+			│                       ││                                                │
+			│                       ││                                                │
+			╰───────────────────────╯│                                                │
+			╭commits────────────────╮│                                                │
+			│                       ││                                                │
+			│                       ││                                                │
+			╰───────────────────────╯│                                                │
+			╭stash──────────────────╮│                                                │
+			│                       ││                                                │
+			╰───────────────────────╯╰────────────────────────────────────────────────╯
+			<options──────────────────────────────────────────────────────>A<B────────>
+			A: statusSpacer1
+			B: information
+			`,
+		},
 		{
 			name: "half screen mode, enlargedSideViewLocation left",
 			mutateArgs: func(args *WindowArrangementArgs) {