Repository: jesseduffield/lazygit (language: go)

Issue:
UX for committing and tagging is non-obvious 
**Is your feature request related to a problem? Please describe.**

To finalize a commit, I must go back from _commit description_ to _commit summary_, and then hit `return`. It is not obvious that the user has to go back, nor is it sensible. But maybe I am missing something.

<img width="1194" alt="Screenshot 2025-01-01 at 01 19 30" src="https://github.com/user-attachments/assets/8f9dd96e-c3df-496b-a1a8-e23bc1922044" />

**Describe the solution you'd like**

There should be a way of finalizing the commit when the _commit description_ field is in focus (unless _commit summary_ field is empty), such as a keyboard shortcut and/or a button.

**Describe alternatives you've considered**

One solution that works is to move the focus back to the _commit summary_ field, and then hit `return`.



Discussion / hints:
You can press shift-return to commit from the description field. The only problem with this is that it's not obvious or discoverable, but once you know it, it works quite well.
We could show the shift+enter keybinding at the bottom left of the screen to make it (slightly) more discoverable
(It's alt-enter of course, I got that wrong.)

I was just working on adding the keybinding to the legend on the top-right when the description panel is focused; that would work well, but it gets a little crowded, and looks bad on very small screens. I'll try to add it at the bottom.

Fix patch:
diff --git a/pkg/gui/controllers/commit_description_controller.go b/pkg/gui/controllers/commit_description_controller.go
index 9f1fe78e58d..aea6cfbdf1a 100644
--- a/pkg/gui/controllers/commit_description_controller.go
+++ b/pkg/gui/controllers/commit_description_controller.go
@@ -3,7 +3,9 @@ package controllers
 import (
 	"github.com/jesseduffield/gocui"
 	"github.com/jesseduffield/lazygit/pkg/gui/context"
+	"github.com/jesseduffield/lazygit/pkg/gui/keybindings"
 	"github.com/jesseduffield/lazygit/pkg/gui/types"
+	"github.com/jesseduffield/lazygit/pkg/utils"
 )
 
 type CommitDescriptionController struct {
@@ -59,6 +61,15 @@ func (self *CommitDescriptionController) GetMouseKeybindings(opts types.Keybindi
 	}
 }
 
+func (self *CommitDescriptionController) GetOnFocus() func(types.OnFocusOpts) {
+	return func(types.OnFocusOpts) {
+		self.c.Views().CommitDescription.Footer = utils.ResolvePlaceholderString(self.c.Tr.CommitDescriptionFooter,
+			map[string]string{
+				"confirmInEditorKeybinding": keybindings.Label(self.c.UserConfig().Keybinding.Universal.ConfirmInEditor),
+			})
+	}
+}
+
 func (self *CommitDescriptionController) switchToCommitMessage() error {
 	self.c.Context().Replace(self.c.Contexts().CommitMessage)
 	return nil
diff --git a/pkg/gui/controllers/commit_message_controller.go b/pkg/gui/controllers/commit_message_controller.go
index 93be127a00b..28168ef1801 100644
--- a/pkg/gui/controllers/commit_message_controller.go
+++ b/pkg/gui/controllers/commit_message_controller.go
@@ -69,6 +69,12 @@ func (self *CommitMessageController) GetMouseKeybindings(opts types.KeybindingsO
 	}
 }
 
+func (self *CommitMessageController) GetOnFocus() func(types.OnFocusOpts) {
+	return func(types.OnFocusOpts) {
+		self.c.Views().CommitDescription.Footer = ""
+	}
+}
+
 func (self *CommitMessageController) GetOnFocusLost() func(types.OnFocusLostOpts) {
 	return func(types.OnFocusLostOpts) {
 		self.context().RenderCommitLength()
diff --git a/pkg/i18n/english.go b/pkg/i18n/english.go
index 4eb91077ff5..e777bdc9619 100644
--- a/pkg/i18n/english.go
+++ b/pkg/i18n/english.go
@@ -290,6 +290,7 @@ type TranslationSet struct {
 	CommitSummaryTitle                    string
 	CommitDescriptionTitle                string
 	CommitDescriptionSubTitle             string
+	CommitDescriptionFooter               string
 	LocalBranchesTitle                    string
 	SearchTitle                           string
 	TagsTitle                             string
@@ -1290,6 +1291,7 @@ func EnglishTranslationSet() *TranslationSet {
 		CommitSummaryTitle:                   "Commit summary",
 		CommitDescriptionTitle:               "Commit description",
 		CommitDescriptionSubTitle:            "Press {{.togglePanelKeyBinding}} to toggle focus, {{.commitMenuKeybinding}} to open menu",
+		CommitDescriptionFooter:              "Press {{.confirmInEditorKeybinding}} to commit",
 		LocalBranchesTitle:                   "Local branches",
 		SearchTitle:                          "Search",
 		TagsTitle:                            "Tags",


Test patch: