From 7bddf532235cc67d847fd70d8f709b6401737936 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Tue, 2 Jan 2024 14:00:36 +1100 Subject: Improve keybinding descriptions This adds a bunch of tooltips to keybindings and updates some keybinding descriptions (i.e. labels). It's in preparation for displaying more keybindings on-screen (in the bottom right of the screen), and so due in part to laziness it shortens some descriptions so that we don't need to manage both a short and long description (for on-screen vs in-menu). Nonetheless I've added a ShortDescription field for when we do want to have both a short and long description. You'll notice that some keybindings I deemed unworthy of the options view have longer descriptions, because I could get away with it. --- pkg/gui/controllers/basic_commits_controller.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'pkg/gui/controllers/basic_commits_controller.go') diff --git a/pkg/gui/controllers/basic_commits_controller.go b/pkg/gui/controllers/basic_commits_controller.go index 6c378ecf0..c62818df9 100644 --- a/pkg/gui/controllers/basic_commits_controller.go +++ b/pkg/gui/controllers/basic_commits_controller.go @@ -5,7 +5,9 @@ import ( "github.com/jesseduffield/lazygit/pkg/commands/git_commands" "github.com/jesseduffield/lazygit/pkg/commands/models" + "github.com/jesseduffield/lazygit/pkg/gui/keybindings" "github.com/jesseduffield/lazygit/pkg/gui/types" + "github.com/jesseduffield/lazygit/pkg/utils" ) // This controller is for all contexts that contain a list of commits. @@ -48,13 +50,15 @@ func (self *BasicCommitsController) GetKeybindings(opts types.KeybindingsOpts) [ Key: opts.GetKey(opts.Config.Commits.CheckoutCommit), Handler: self.withItem(self.checkout), GetDisabledReason: self.require(self.singleItemSelected()), - Description: self.c.Tr.CheckoutCommit, + Description: self.c.Tr.Checkout, + Tooltip: self.c.Tr.CheckoutCommitTooltip, }, { Key: opts.GetKey(opts.Config.Commits.CopyCommitAttributeToClipboard), Handler: self.withItem(self.copyCommitAttribute), GetDisabledReason: self.require(self.singleItemSelected()), Description: self.c.Tr.CopyCommitAttributeToClipboard, + Tooltip: self.c.Tr.CopyCommitAttributeToClipboardTooltip, OpensMenu: true, }, { @@ -74,12 +78,19 @@ func (self *BasicCommitsController) GetKeybindings(opts types.KeybindingsOpts) [ Handler: self.withItem(self.createResetMenu), GetDisabledReason: self.require(self.singleItemSelected()), Description: self.c.Tr.ViewResetOptions, + Tooltip: self.c.Tr.ResetTooltip, OpensMenu: true, }, { Key: opts.GetKey(opts.Config.Commits.CherryPickCopy), Handler: self.withItem(self.copyRange), Description: self.c.Tr.CherryPickCopy, + Tooltip: utils.ResolvePlaceholderString(self.c.Tr.CherryPickCopyTooltip, + map[string]string{ + "paste": keybindings.Label(opts.Config.Commits.PasteCommits), + "escape": keybindings.Label(opts.Config.Universal.Return), + }, + ), }, { Key: opts.GetKey(opts.Config.Commits.ResetCherryPick), -- cgit v1.2.3