feat: clear screen on SSH enter/exit, host list scrolling, 'e' edit key

- tea.Batch(tea.ClearScreen, sshConnectCmd) before SSH starts so TUI
  output doesn't bleed into SSH terminal
- tea.ClearScreen after SSH exits so SSH output doesn't ghost in TUI
- Host list now paginates: only (term_height - 8) / 5 cards shown,
  viewport follows selectedIndex with centered scrolling
- Shows 'N of M hosts' indicator when content is clipped
- Added 'e' key alias for editing host (Ctrl+E or E)
This commit is contained in:
swanadiva
2026-06-23 16:04:38 +07:00
parent 2442920616
commit c7568e0bf4
2 changed files with 29 additions and 5 deletions
+2 -2
View File
@@ -62,13 +62,13 @@ func (m *Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
return m, tea.Quit
case sshConnectToMsg:
return m, sshConnectCmd(msg.host, m.dataDir)
return m, tea.Batch(tea.ClearScreen, sshConnectCmd(msg.host, m.dataDir))
case sshExitMsg:
if msg.err != nil {
m.Error = msg.err
}
return m, nil
return m, tea.ClearScreen
case openHostFormMsg:
var tab Tab