1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-06-15 00:15:32 +02:00

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.
This commit is contained in:
Jesse Duffield
2024-01-02 14:00:36 +11:00
parent 0aa6109d4d
commit 7bddf53223
43 changed files with 2525 additions and 2199 deletions

View File

@ -48,6 +48,7 @@ func (self *BranchesController) GetKeybindings(opts types.KeybindingsOpts) []*ty
self.notPulling,
),
Description: self.c.Tr.Checkout,
Tooltip: self.c.Tr.CheckoutTooltip,
},
{
Key: opts.GetKey(opts.Config.Universal.New),
@ -78,18 +79,21 @@ func (self *BranchesController) GetKeybindings(opts types.KeybindingsOpts) []*ty
Key: opts.GetKey(opts.Config.Branches.CheckoutBranchByName),
Handler: self.checkoutByName,
Description: self.c.Tr.CheckoutByName,
Tooltip: self.c.Tr.CheckoutByNameTooltip,
},
{
Key: opts.GetKey(opts.Config.Branches.ForceCheckoutBranch),
Handler: self.forceCheckout,
GetDisabledReason: self.require(self.singleItemSelected()),
Description: self.c.Tr.ForceCheckout,
Tooltip: self.c.Tr.ForceCheckoutTooltip,
},
{
Key: opts.GetKey(opts.Config.Universal.Remove),
Handler: self.withItem(self.delete),
GetDisabledReason: self.require(self.singleItemSelected(self.branchIsReal)),
Description: self.c.Tr.ViewDeleteOptions,
Description: self.c.Tr.Delete,
Tooltip: self.c.Tr.BranchDeleteTooltip,
OpensMenu: true,
},
{
@ -99,24 +103,27 @@ func (self *BranchesController) GetKeybindings(opts types.KeybindingsOpts) []*ty
self.singleItemSelected(self.notRebasingOntoSelf),
),
Description: self.c.Tr.RebaseBranch,
Tooltip: self.c.Tr.RebaseBranchTooltip,
},
{
Key: opts.GetKey(opts.Config.Branches.MergeIntoCurrentBranch),
Handler: opts.Guards.OutsideFilterMode(self.merge),
GetDisabledReason: self.require(self.singleItemSelected()),
Description: self.c.Tr.MergeIntoCurrentBranch,
Description: self.c.Tr.Merge,
Tooltip: self.c.Tr.MergeBranchTooltip,
},
{
Key: opts.GetKey(opts.Config.Branches.FastForward),
Handler: self.withItem(self.fastForward),
GetDisabledReason: self.require(self.singleItemSelected(self.branchIsReal)),
Description: self.c.Tr.FastForward,
Tooltip: self.c.Tr.FastForwardTooltip,
},
{
Key: opts.GetKey(opts.Config.Branches.CreateTag),
Handler: self.withItem(self.createTag),
GetDisabledReason: self.require(self.singleItemSelected()),
Description: self.c.Tr.CreateTag,
Description: self.c.Tr.NewTag,
},
{
Key: opts.GetKey(opts.Config.Branches.SortOrder),
@ -142,6 +149,7 @@ func (self *BranchesController) GetKeybindings(opts types.KeybindingsOpts) []*ty
GetDisabledReason: self.require(self.singleItemSelected()),
Description: self.c.Tr.ViewBranchUpstreamOptions,
Tooltip: self.c.Tr.ViewBranchUpstreamOptionsTooltip,
ShortDescription: self.c.Tr.Upstream,
OpensMenu: true,
},
}