fix(ui): help menu on file list view (#719)

Eldon created

* fix(ui): Add additional key function indicators

Add the h and l indications in the help message when
those keys select items from lists.

* fix(ui); Fix action long help on file views

Prior to this commit, the copy command help was not overwritten as
intended, and blame and toggle line number options were shown in help on
the file list view page, but only functioned on the file content view
page.

Change summary

pkg/ui/keymap/keymap.go    |  4 ++--
pkg/ui/pages/repo/files.go | 23 ++++++++++++-----------
2 files changed, 14 insertions(+), 13 deletions(-)

Detailed changes

pkg/ui/keymap/keymap.go 🔗

@@ -198,7 +198,7 @@ func DefaultKeyMap() *KeyMap {
 			"right",
 		),
 		key.WithHelp(
-			"→",
+			"→/l",
 			"select",
 		),
 	)
@@ -210,7 +210,7 @@ func DefaultKeyMap() *KeyMap {
 			"backspace",
 		),
 		key.WithHelp(
-			"←",
+			"←/h",
 			"back",
 		),
 	)

pkg/ui/pages/repo/files.go 🔗

@@ -151,17 +151,7 @@ func (f *Files) ShortHelp() []key.Binding {
 func (f *Files) FullHelp() [][]key.Binding {
 	b := make([][]key.Binding, 0)
 	copyKey := f.common.KeyMap.Copy
-	actionKeys := []key.Binding{
-		copyKey,
-	}
-	if !f.code.UseGlamour {
-		actionKeys = append(actionKeys, lineNo)
-	}
-	actionKeys = append(actionKeys, blameView)
-	if common.IsFileMarkdown(f.currentContent.content, f.currentContent.ext) &&
-		!f.blameView {
-		actionKeys = append(actionKeys, preview)
-	}
+	actionKeys := []key.Binding{}
 	switch f.activeView {
 	case filesViewFiles:
 		copyKey.SetHelp("c", "copy name")
@@ -183,6 +173,14 @@ func (f *Files) FullHelp() [][]key.Binding {
 			},
 		}...)
 	case filesViewContent:
+		if !f.code.UseGlamour {
+			actionKeys = append(actionKeys, lineNo)
+		}
+		actionKeys = append(actionKeys, blameView)
+		if common.IsFileMarkdown(f.currentContent.content, f.currentContent.ext) &&
+			!f.blameView {
+			actionKeys = append(actionKeys, preview)
+		}
 		copyKey.SetHelp("c", "copy content")
 		k := f.code.KeyMap
 		b = append(b, []key.Binding{
@@ -203,6 +201,9 @@ func (f *Files) FullHelp() [][]key.Binding {
 			},
 		}...)
 	}
+	actionKeys = append([]key.Binding{
+		copyKey,
+	}, actionKeys...)
 	return append(b, actionKeys)
 }