Description
I'm always frustrated when I press c
to commit, start typing a message, and then realize I need to look at some parts of the staged changes (in order to describe them in the message) that are currently not visible, either because they are behind the modal commit message panel, or in a file that is currenly not selected.
For committing this is not a huge deal because I can cancel the commit, look at the changes (maybe copy some function name to the clipboard), and then hit c
again to resume. Since lazygit remembers the commit message, I can continue typing where I left off. It's still a bit cumbersome though, and also this is not an option when rewording a commit.
To improve this, it would be nice if the commit message panel was non-modal, like in git gui
or in VS Code. Here's a rough mockup of what this could look like:
The idea is that pressing c
(or r
in the commits panel) temporarily replaces the Command Log pane with a Commit Message pane. This could allow browsing the staged files (or the current commit in case of a reword) while the panel is showing.
Challenges
- It's unclear how to navigate away from the commit message panel to one of the side panels. The global navigation keys are tab, left/right, or 1-5, and these all do different things when the commit message is focused (tab switches between message and description). Clicking with the mouse in another panel would work, but for users who prefer the keyboard I don't have a great idea.
- If we do find a way to navigate away, then it's unclear under which conditions it should stay open, or when it should auto-close. I think it would be a bit weird if the only way to get the Command Log back is to hit Esc in the commit message; I feel it should auto-close under certain conditions, but I'm not sure what those are. For example, for committing the panel could stay open if you navigate to the Files panel, but auto-close when you focus any other side panel. For rewording it could stay open only if you switch to the Commits panel, but auto-close for any other panel. But I'm not sure this is the best rule.
- What if you start to reword a commit, and then while the commit message panel is showing you go to the Commits panel and rebase the branch (i.e. drop the commit). If you then go back to the panel and hit enter, the reword will work because the original commit still exists (until it is garbage-collected), but you are then rewording a commit that you don't see, which could be confusing.
I suppose there are probably many other issues that I'm not seeing yet, and it is probably a pretty large amount of work to implement this. But I'm interested in giving it a try.