shkeeper: simplify action bar (Enter/Ctrl+X/Ctrl+A/Ctrl+E/Ctrl+F/Ins/?/Ctrl+Q), move rest to help screen

This commit is contained in:
mirivlad 2026-06-03 16:08:22 +08:00
parent fa9b07e3d5
commit 741e9a836d
3 changed files with 5 additions and 5 deletions

View File

@ -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"},

View File

@ -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)
}

View File

@ -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"},