From 741e9a836d9177209a7fd5c1705b2c0c91c5a3ed Mon Sep 17 00:00:00 2001 From: mirivlad Date: Wed, 3 Jun 2026 16:08:22 +0800 Subject: [PATCH] shkeeper: simplify action bar (Enter/Ctrl+X/Ctrl+A/Ctrl+E/Ctrl+F/Ins/?/Ctrl+Q), move rest to help screen --- internal/tui/app.go | 4 +--- internal/tui/app_test.go | 4 ++-- internal/tui/help_screen.go | 2 ++ 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/tui/app.go b/internal/tui/app.go index 5cb489f..352e411 100644 --- a/internal/tui/app.go +++ b/internal/tui/app.go @@ -1564,12 +1564,10 @@ func (m *tuiModel) listHelpItems(selectedCount int, hasBackgroundResult bool) [] } items = append(items, helpItem{Key: "Enter", Action: "connect"}, + helpItem{Key: "Ctrl+X", Action: "actions"}, helpItem{Key: "Ctrl+A", Action: "add"}, helpItem{Key: "Ctrl+E", Action: "edit"}, helpItem{Key: "Ctrl+F", Action: "search"}, - helpItem{Key: "Ctrl+P", Action: "tmpl"}, - helpItem{Key: "Ctrl+G", Action: "tags"}, - helpItem{Key: "Ctrl+W", Action: "forwards"}, helpItem{Key: "Ins", Action: insAction}, helpItem{Key: "?", Action: "help"}, helpItem{Key: "Ctrl+Q", Action: "quit"}, diff --git a/internal/tui/app_test.go b/internal/tui/app_test.go index 26a481c..88141bd 100644 --- a/internal/tui/app_test.go +++ b/internal/tui/app_test.go @@ -117,7 +117,7 @@ func TestServerListHelpWrapsOnNarrowTerminal(t *testing.T) { t.Fatalf("expected help line to be bounded, got width %d: %q\nview:\n%s", lipgloss.Width(line), line, view) } } - for _, want := range []string{"Ctrl+P", "tmpl", "Ctrl+F", "search", "?", "help"} { + for _, want := range []string{"Ctrl+X", "actions", "Ctrl+F", "search", "?", "help"} { if !strings.Contains(view, want) { t.Fatalf("expected help to contain %q\nview:\n%s", want, view) } @@ -148,7 +148,7 @@ func TestServerListHelpWrapsSelectionAndResultHints(t *testing.T) { plainLines = append(plainLines, plainHelpLine(line)) } joined := strings.Join(plainLines, "\n") - for _, want := range []string{"Ins: select (2 selected)", "Esc: clear result", "Ctrl+P: tmpl", "Ctrl+Q: quit"} { + for _, want := range []string{"Ins: select (2 selected)", "Esc: clear result", "Ctrl+X: actions", "Ctrl+Q: quit"} { if !strings.Contains(joined, want) { t.Fatalf("expected wrapped help to contain %q\nlines:%#v", want, lines) } diff --git a/internal/tui/help_screen.go b/internal/tui/help_screen.go index 154100a..f81a6b9 100644 --- a/internal/tui/help_screen.go +++ b/internal/tui/help_screen.go @@ -25,6 +25,8 @@ func newHelpScreenModel(w, h int) *helpScreenModel { helpScreenItem{key: "Esc", action: "Back / Cancel", section: "Navigation"}, helpScreenItem{key: "Ctrl+A", action: "Add server", section: "Actions"}, helpScreenItem{key: "Ctrl+E", action: "Edit server", section: "Actions"}, + helpScreenItem{key: "Ctrl+W", action: "Manage port forwards", section: "Actions"}, + helpScreenItem{key: "Ctrl+X", action: "Action menu (delete, test, tags, tunnel)", section: "Actions"}, helpScreenItem{key: "Ctrl+D", action: "Delete server", section: "Actions"}, helpScreenItem{key: "Ctrl+T", action: "Test connection", section: "Actions"}, helpScreenItem{key: "Ctrl+F", action: "Search", section: "Actions"},