Commit Graph

12 Commits

Author SHA1 Message Date
swanadiva 1d2e29d20a feat: integrate security features into TUI
- SFTPBrowserTab: added storagePassword, passphraseCallback fields
- Model: added storagePassword, knownHosts fields
- cmd/hostkeeper/tui.go: initialize known_hosts on startup
- SFTP connect: wire passphrase callback to SSH client
- SetStoragePassword/SetKnownHosts/SetPassphraseCallback methods
2026-06-25 13:32:59 +07:00
swanadiva 55b5c7b5a0 fix: SFTP auto-refresh after file transfer
- Added program *tea.Program to SFTPBrowserTab and Model
- SetProgram() allows goroutines to send messages to Bubble Tea
- After transfer: program.Send(sftpRefreshMsg{}) triggers re-render
- Model stores program reference, passes to SFTP tab on creation
2026-06-24 14:32:30 +07:00
swanadiva 7d41391e13 fix: Space/Left/Right passthrough in host form, key/snippet refresh on save/delete, WindowSize to all tabs, footer improvements 2026-06-23 18:48:50 +07:00
swanadiva c7568e0bf4 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)
2026-06-23 16:04:38 +07:00
swanadiva daa20ac72b fix: sshCmd closure bug + error display
CRITICAL BUG: sshConnectCmd wrapped tea.ExecProcess inside an extra
closure, so Bubble Tea never executed the SSH process — Enter appeared
to do nothing.

Fix:
- sshConnectCmd now returns tea.ExecProcess directly (no extra closure)
- tea.ExecProcess handles all process lifecycle (start, PTY, exit)
- sshExitMsg errors are shown in host list view (ErrorStyle)
- Error routed via Model.Error → HostListTab.err → View()
2026-06-23 15:50:20 +07:00
swanadiva 7b06793002 feat: native SSH delegation via tea.ExecProcess + Gruvbox palette
Phase A — Tamagosh-inspired redesign:
- Replace goroutine-based SSH (crypto/ssh) with tea.ExecProcess + native ssh binary
- Zero-lag SSH: native binary pegang TTY langsung, ga ada Go buffering
- Password auth via sshpass -e (SSHPASS env)
- Key auth via ssh -i <tmpfile> + SSH_ASKPASS for passphrase
- ControlMaster sockets for fast reconnect
- Add askpass subcommand for SSH_ASKPASS support
- Gruvbox Material Dark Hard palette for comfortable viewing
- Clean up old session messages (openSessionMsg, sessionOutputMsg, sessionDoneMsg)
- Remove 354-line session.go, replace with 150-line ssh.go
2026-06-23 15:36:40 +07:00
swanadiva 43858dda87 feat: TUI Key & Snippet Management - Task 19
- KeyListTab: view/add/edit/delete SSH keys (Ctrl+K from host list)
- KeyFormTab: add/edit key form with name, type, private key, passphrase
- SnippetListTab: view/add/edit/delete snippets (Ctrl+P from host list)
- SnippetFormTab: add/edit snippet form with name, command, description, tags
- Updated status bar with new hints
- Save/delete commands for both key pairs and snippets
2026-06-23 15:10:20 +07:00
swanadiva 94ec00c303 feat: TUI SFTP Browser Tab - Task 18
- SFTPBrowserTab with remote directory browsing
- Open via Ctrl+F from host list
- Navigate dirs, filter with /, refresh with r
- Dir/icon display with file sizes
- Sort dirs first, then by name
2026-06-23 15:08:22 +07:00
swanadiva 3dc482e353 feat: TUI Host Forms (add/edit) - Task 17
- HostFormTab with textinput fields for all host fields
- Add (Ctrl+N) and Edit (Ctrl+E) from host list
- Save to JSON storage, auto-reload on save
- Esc to cancel, navigable form with keyboard
2026-06-23 15:05:08 +07:00
swanadiva 98dfc1c79c feat: Task 16 — SSH Session Tab (multi-session)
- pkg/tui/session.go — SessionTab with live SSH terminal in a tab
- pkg/tui/messages.go — quitMsg, openSessionMsg, sessionOutputMsg
- pkg/tui/tabs.go — Tab.Close() interface, Add() returns tea.Cmd
- pkg/tui/host_list_tab.go — Enter opens session tab, q quits
- pkg/tui/tui.go — handle openSessionMsg/quitMsg, SetDataDir
- cmd/hostkeeper/tui.go — pass dataDir to model
2026-06-23 14:54:44 +07:00
swanadiva 5d9e38f8db feat: Task 15 — TUI Tab Framework + Orange Theme
- pkg/tui/styles.go — orange theme palette and component styles
- pkg/tui/tabs.go — Tab interface + TabManager with add/close/next/prev
- pkg/tui/host_list_tab.go — HostListTab implementing Tab interface
- pkg/tui/tui.go — refactored to use TabManager (backward compatible)
- pkg/tui/host_list.go — removed (logic moved to host_list_tab.go)
- pkg/tui/tui_test.go — adapted + added TabManager tests
2026-06-23 14:51:13 +07:00
swanadiva fbe444c3ab feat: implement basic TUI framework with host list
- Add Bubble Tea TUI model with Init/Update/View
- Implement host list screen with keyboard navigation (up/down/enter/q)
- Add styled rendering for hosts, selection, tags
- Create hostkeeper tui CLI command
- Add tests for TUI initialization and host loading
- Update project state documentation
2026-06-23 13:54:49 +07:00