summaryrefslogtreecommitdiffstats
path: root/pkg/gui/controllers/basic_commits_controller.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2024-01-02 14:00:36 +1100
committerJesse Duffield <jessedduffield@gmail.com>2024-01-28 08:12:01 +1100
commit7bddf532235cc67d847fd70d8f709b6401737936 (patch)
treec248ea926268ecd1e844d924fac438c6f1701edd /pkg/gui/controllers/basic_commits_controller.go
parent0aa6109d4d767cf77d4fb3eeefd0ac477d718ccf (diff)
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.
Diffstat (limited to 'pkg/gui/controllers/basic_commits_controller.go')
-rw-r--r--pkg/gui/controllers/basic_commits_controller.go13
1 files changed, 12 insertions, 1 deletions
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),