remove help model

This commit is contained in:
Adem Baccara
2025-08-26 19:52:16 +01:00
parent a73e7290b0
commit c24085c585
3 changed files with 14 additions and 39 deletions
+12 -37
View File
@@ -72,9 +72,6 @@ func (t *tui) handleGlobalKeys(event *tcell.EventKey) *tcell.EventKey {
case 't':
t.handleTagsEdit()
return nil
case '?':
t.handleHelpShow()
return nil
}
if event.Key() == tcell.KeyEnter {
@@ -200,10 +197,6 @@ func (t *tui) handleFormCancel() {
t.returnToMain()
}
func (t *tui) handleHelpShow() {
t.showHelpModal()
}
func (t *tui) handlePingSelected() {
if server, ok := t.serverList.GetSelectedServer(); ok {
alias := server.Alias
@@ -286,8 +279,18 @@ func (t *tui) showConnectModal(server domain.Server) {
SetDoneFunc(func(buttonIndex int, buttonLabel string) {
if buttonIndex == 0 {
// Suspend the TUI while running the external ssh command.
t.app.Suspend(func() {
_ = t.serverService.SSH(server.Alias)
t.app.Suspend(func() {
err := t.serverService.SSH(server.Alias)
if err != nil {
// Show a brief status after we resume
t.app.QueueUpdateDraw(func() {
if strings.Contains(strings.ToLower(err.Error()), "timeout") {
t.showStatusTempColor("SSH timeout, returning to list", "#FF6B6B")
} else {
t.showStatusTempColor("SSH failed: "+err.Error(), "#FF6B6B")
}
})
}
})
// Refresh to reflect updated last seen and ssh count
t.refreshServerList()
@@ -350,34 +353,6 @@ func (t *tui) showEditTagsForm(server domain.Server) {
t.app.SetFocus(form)
}
func (t *tui) showHelpModal() {
text := "Keyboard shortcuts:\n\n" +
" ↑/↓ Navigate\n" +
" Enter SSH connect \n" +
" c Copy SSH command \n" +
" g Ping server (TCP to SSH port)\n" +
" r Refresh list (background)\n" +
" a Add server \n" +
" e Edit server \n" +
" t Edit tags (quick)\n" +
" d Delete entry \n" +
" p Pin/Unpin server \n" +
" s Switch sort field (Alias ↔ Last SSH), keep direction\n" +
" Shift+S Toggle sort direction (↑/↓) for current field\n" +
" / Focus search\n" +
" q Quit\n" +
" ? Help\n"
modal := tview.NewModal().
SetText(text).
AddButtons([]string{"Close"}).
SetDoneFunc(func(buttonIndex int, buttonLabel string) {
t.handleModalClose()
})
t.app.SetRoot(modal, true)
}
// =============================================================================
// UI State Management (hide UI elements)
// =============================================================================
+1 -1
View File
@@ -22,6 +22,6 @@ import (
func NewHintBar() *tview.TextView {
hint := tview.NewTextView().SetDynamicColors(true)
hint.SetBackgroundColor(tcell.Color233)
hint.SetText("[#BBBBBB]Press [::b]/[-:-:b] to search… • ↑↓ Navigate • Enter SSH • c Copy SSH • g Ping • r Refresh • a Add • e Edit • t Tags • d Delete • p Pin/Unpin • s Sort • ? Help[-]")
hint.SetText("[#BBBBBB]Press [::b]/[-:-:b] to search… • ↑↓ Navigate • Enter SSH • c Copy SSH • g Ping • r Refresh • a Add • e Edit • t Tags • d Delete • p Pin/Unpin • s Sort[-]")
return hint
}
+1 -1
View File
@@ -20,7 +20,7 @@ import (
)
func DefaultStatusText() string {
return "[white]↑↓[-] Navigate • [white]Enter[-] SSH • [white]c[-] Copy SSH • [white]a[-] Add • [white]e[-] Edit • [white]g[-] Ping • [white]d[-] Delete • [white]p[-] Pin/Unpin • [white]/[-] Search • [white]q[-] Quit • [white]?[-] Help"
return "[white]↑↓[-] Navigate • [white]Enter[-] SSH • [white]c[-] Copy SSH • [white]a[-] Add • [white]e[-] Edit • [white]g[-] Ping • [white]d[-] Delete • [white]p[-] Pin/Unpin • [white]/[-] Search • [white]q[-] Quit"
}
func NewStatusBar() *tview.TextView {