jesseduffield / lazygit

simple terminal UI for git commands
MIT License
51.38k stars 1.8k forks source link

Option to hide panels #3621

Closed nullromo closed 4 months ago

nullromo commented 4 months ago

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.

gui:
  showCommandLog: false

I just want a similar option for the other panels too.

mark2185 commented 4 months ago

Try pressing + and _ to switch screen modes to see if that helps.

stefanhaller commented 4 months ago

A few things to try:

nullromo commented 4 months ago

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 Enter on a file hides the file list, which is not ideal. And having to press + 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, 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.

stefanhaller commented 4 months ago

This is great! Not sure where this came from, since it's not in the docs, 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.

stefanhaller commented 4 months ago

Since it was so easy to do, I went ahead and made a PR: #3623. I find it useful, and I like a value of 3 myself. @nullromo Can you build from source and give it a try?

nullromo commented 4 months ago

I would love to, but I haven't worked with Go before. I got as far as cloning the repo, checking out the branch, and installing go. Now I'm here and wildly googling...

$ go version
go version go1.18.1 linux/amd64
$ pwd
/home/kkovacs/lazygit
$ make
go build -gcflags='all=-N -l'
pkg/config/user_config_validation.go:5:2: cannot find package "." in:
        /home/kkovacs/lazygit/vendor/slices
make: *** [Makefile:6: build] Error 1

No idea what this means. Kind of embarrassing but hey, you have start somewhere.

EDIT I am reading CONTRIBUTING.md now...

stefanhaller commented 4 months ago

Your version of go is very old, where did you install that from? Lazygit requires 1.22 to build.

nullromo commented 4 months ago

sudo apt-get -y install golang-go

nullromo commented 4 months ago

Ok, this works

$ sudo add-apt-repository ppa:longsleep/golang-backports
$ sudo apt-get update
$ sudo apt-get install golang
$ go version
go version go1.22.3 linux/amd64
nullromo commented 4 months ago

Ok after that brief aside, I was able to get it working. Looks good! Setting the value between 22 and 32 looks good for me. However, it's a little unclear what the option actually does. I think it's pretty easy to understand the concept of "weight," but not that intuitive to translate the weight into what that actually looks like. For instance, I had to mess around with the number and set it to 5, 10, 20, 30, 40, etc. just to see what looked good.

But anyway, I'm not sure that really matters. Messing around with it is fine. And it works! So if this gets merged, it's fully providing what I asked for in the original issue ❤️

sirenkovladd commented 1 week ago

I would like to reopen this issue as in my opinion the problem that is indicated in the title is not solved

I would like to be able to hide some panels permanently Or better to be able to change their order something like

groupBlocks: File,Submodules;Commits;LocalBranch,Remotes;Status,Tags

# File, Submodules [1]
# Commits [2]
# LocalBranch, Remotes [3]
# Status, Tags [4]

this way it will allow removing blocks that are not used and move blocks to other subcategories