lazygit icon indicating copy to clipboard operation
lazygit copied to clipboard

Make Staged and Unstaged Changes to parallel tabs

Open Saafo opened this issue 2 years ago • 3 comments

Is your feature request related to a problem? Please describe. Currently, Staged Changes and Unstaged Changes are separated blocks and take screen space simultaneously. This takes too much space, cannot show many changes in each, and we rare to read staged and unstaged simultaneously.

Describe the solution you'd like make Staged Changes and Unstaged Changes to parallel tabs like Files and Submodules just like that in Tower. And indicate whether Staged Changes or Unstaged Changes is empty on the title.

Describe alternatives you've considered At least, do not show (Un)staged Changes area when it's empty.

Additional context Add any other context or screenshots about the feature request here.

Saafo avatar Apr 23 '23 06:04 Saafo

I don't understand this request. If I enter a file to stage some of its hunks (as opposed to staging the entire file), I need to see both staged and unstaged changes at the same time, otherwise I can't tell what I have staged already, or what there is left to stage.

At least, do not show (Un)staged Changes area when it's empty.

If you haven't entered a file for staging individual hunks or lines, it behaves like this already. If you don't care about staging individual hunks, just don't enter the file, but stage the entire file using space.

stefanhaller avatar Apr 23 '23 09:04 stefanhaller

OK, after looking at Tower I understand what you mean. Yes, I can see how this could be useful to save screen space.

Two detail considerations:

  • It would have to be optional, because people with larger screens might prefer the current behavior. How do we turn it on? One option could be to reuse the existing gui.mainPanelSplitMode config (which currently can be "horizontal", "vertical", or "flexible"), and add a new value "none" which means "never split the panel, show only one at a time". The problem with this is that the config is also used for custom patch mode, in which case we do need to see both views at the same time. So maybe it's better to add a new config such as gui.showStagedAndUnstagedChangesAtOnce, which defaults to true.
  • For how long should lazygit remember which of the two views was visible last? In Tower, it always falls back to showing unstaged changes whenever you switch to a different file; I think this is not good enough, it should probably remember which view was visible last. I'm just not sure for how long; if I am looking at staged changes, and then select a file that has only unstaged changes, we obviously need to switch to the unstaged view, but if I then select a file that has both, which ones do I want to see now?

stefanhaller avatar Apr 23 '23 12:04 stefanhaller

Yes! It's exactly what I mean. I use my terminal in a small window, so saving space is very important to me, now the empty staging area took up too much space.

The remember thing doesn't confused me in Tower cause it doesn't trouble me much. And I think I can quickly change to another tab by the key bindings in lazygit, which is even more better.

Thanks and expecting for the follow-ups!

Saafo avatar Apr 24 '23 11:04 Saafo