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
This commit is contained in:
swanadiva
2026-06-23 13:54:49 +07:00
parent d6b810de47
commit fbe444c3ab
5 changed files with 293 additions and 8 deletions
+32
View File
@@ -0,0 +1,32 @@
package tui
import (
"testing"
)
func TestTUIInitialization(t *testing.T) {
ui := New()
if ui == nil {
t.Fatal("Failed to initialize TUI")
}
if ui.CurrentScreen != ScreenHostList {
t.Errorf("expected CurrentScreen ScreenHostList, got %d", ui.CurrentScreen)
}
if ui.Quit {
t.Error("expected Quit to be false")
}
}
func TestTUILoadHosts(t *testing.T) {
ui := New()
if ui == nil {
t.Fatal("Failed to initialize TUI")
}
ui.LoadHosts(nil)
if ui.Hosts != nil {
t.Error("expected Hosts to be nil")
}
}