fix(tui): aide compacte pour que le raccourci i soit visible
Libellés courts et français, i placé juste après entrée, touches custom aussi dans l'aide complète (?). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2 files changed
+17 −6
M
internal/tui/list.go
+17 −6
M
vhs/demo.gif
Binary file — not shown.
internal/tui/list.go
@@ -112,15 +112,26 @@ func Run(hosts []host.Host, canImportSSH bool) (Result, error) {
l := list.New(items, list.NewDefaultDelegate(), 0, 0)
l.Title = "sssh"
l.SetStatusBarItemName("host", "hosts")
- l.AdditionalShortHelpKeys = func() []key.Binding {
+
+ // Libellés compacts (et en français) pour que toute l'aide, touche i
+ // comprise, tienne sur une ligne en 80 colonnes.
+ l.KeyMap.CursorUp.SetHelp("↑", "haut")
+ l.KeyMap.CursorDown.SetHelp("↓", "bas")
+ l.KeyMap.Filter.SetHelp("/", "filtre")
+ l.KeyMap.Quit.SetHelp("q", "quitter")
+ l.KeyMap.ShowFullHelp.SetHelp("?", "aide")
+ l.KeyMap.CloseFullHelp.SetHelp("?", "fermer l'aide")
+ extraKeys := func() []key.Binding {
return []key.Binding{
- key.NewBinding(key.WithKeys("enter"), key.WithHelp("entrée", "connexion")),
- key.NewBinding(key.WithKeys("a"), key.WithHelp("a", "ajouter")),
- key.NewBinding(key.WithKeys("e"), key.WithHelp("e", "éditer")),
- key.NewBinding(key.WithKeys("d"), key.WithHelp("d", "supprimer")),
- key.NewBinding(key.WithKeys("i"), key.WithHelp("i", "importer ssh_config")),
+ key.NewBinding(key.WithKeys("enter"), key.WithHelp("↵", "ssh")),
+ key.NewBinding(key.WithKeys("i"), key.WithHelp("i", "import")),
+ key.NewBinding(key.WithKeys("a"), key.WithHelp("a", "ajout")),
+ key.NewBinding(key.WithKeys("e"), key.WithHelp("e", "édite")),
+ key.NewBinding(key.WithKeys("d"), key.WithHelp("d", "suppr")),
}
}
+ l.AdditionalShortHelpKeys = extraKeys
+ l.AdditionalFullHelpKeys = extraKeys
p := tea.NewProgram(model{list: l, canImportSSH: canImportSSH}, tea.WithAltScreen())
out, err := p.Run()
vhs/demo.gif