summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Haller <stefan@haller-berlin.de>2024-02-16 15:43:43 +0100
committerStefan Haller <stefan@haller-berlin.de>2024-02-21 09:55:04 +0100
commit9362aede8f3816bb500feaa4473d90d7bf8883ee (patch)
tree947147e8d72a911ec0191d8383fa27befba25ad1
parentdfabe8db70d4c82afd361a4a90b9ff3c0b48a1b2 (diff)
Add tooltips for reset menu items
-rw-r--r--pkg/gui/controllers/helpers/refs_helper.go10
-rw-r--r--pkg/i18n/english.go6
2 files changed, 12 insertions, 4 deletions
diff --git a/pkg/gui/controllers/helpers/refs_helper.go b/pkg/gui/controllers/helpers/refs_helper.go
index ed5d94e8a..8b066f447 100644
--- a/pkg/gui/controllers/helpers/refs_helper.go
+++ b/pkg/gui/controllers/helpers/refs_helper.go
@@ -166,12 +166,13 @@ func (self *RefsHelper) CreateGitResetMenu(ref string) error {
strength string
label string
key types.Key
+ tooltip string
}
strengths := []strengthWithKey{
// not i18'ing because it's git terminology
- {strength: "mixed", label: "Mixed reset", key: 'm'},
- {strength: "soft", label: "Soft reset", key: 's'},
- {strength: "hard", label: "Hard reset", key: 'h'},
+ {strength: "mixed", label: "Mixed reset", key: 'm', tooltip: self.c.Tr.ResetMixedTooltip},
+ {strength: "soft", label: "Soft reset", key: 's', tooltip: self.c.Tr.ResetSoftTooltip},
+ {strength: "hard", label: "Hard reset", key: 'h', tooltip: self.c.Tr.ResetHardTooltip},
}
menuItems := lo.Map(strengths, func(row strengthWithKey, _ int) *types.MenuItem {
@@ -184,7 +185,8 @@ func (self *RefsHelper) CreateGitResetMenu(ref string) error {
self.c.LogAction("Reset")
return self.ResetToRef(ref, row.strength, []string{})
},
- Key: row.key,
+ Key: row.key,
+ Tooltip: row.tooltip,
}
})
diff --git a/pkg/i18n/english.go b/pkg/i18n/english.go
index 98c3ea5d2..3813a8c30 100644
--- a/pkg/i18n/english.go
+++ b/pkg/i18n/english.go
@@ -398,6 +398,9 @@ type TranslationSet struct {
CommitChangesWithoutHook string
SkipHookPrefixNotConfigured string
ResetTo string
+ ResetSoftTooltip string
+ ResetMixedTooltip string
+ ResetHardTooltip string
PressEnterToReturn string
ViewStashOptions string
ViewStashOptionsTooltip string
@@ -1320,6 +1323,9 @@ func EnglishTranslationSet() TranslationSet {
Delete: "Delete",
Reset: "Reset",
ResetTooltip: "View reset options (soft/mixed/hard) for resetting onto selected item.",
+ ResetSoftTooltip: "Reset HEAD to the chosen commit, and keep the changes between the current and chosen commit as staged changes.",
+ ResetMixedTooltip: "Reset HEAD to the chosen commit, and keep the changes between the current and chosen commit as unstaged changes.",
+ ResetHardTooltip: "Reset HEAD to the chosen commit, and discard all changes between the current and chosen commit, as well as all current modifications in the working tree.",
ViewResetOptions: `Reset`,
FileResetOptionsTooltip: "View reset options for working tree (e.g. nuking the working tree).",
FixupTooltip: "Meld the selected commit into the commit below it. Similar to fixup, but the selected commit's message will be discarded.",