wip: refactoring tui

This commit is contained in:
adamdottv
2025-06-13 10:47:51 -05:00
parent 5706c6ad3a
commit 62b9a30a9c
18 changed files with 111 additions and 716 deletions

View File

@@ -48,7 +48,7 @@ type sessionDialog struct {
height int
modal *modal.Modal
selectedSessionID string
list components.SimpleList[sessionItem]
list components.List[sessionItem]
}
func (s *sessionDialog) Init() tea.Cmd {
@@ -77,7 +77,7 @@ func (s *sessionDialog) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
var cmd tea.Cmd
listModel, cmd := s.list.Update(msg)
s.list = listModel.(components.SimpleList[sessionItem])
s.list = listModel.(components.List[sessionItem])
return s, cmd
}
@@ -98,7 +98,7 @@ func NewSessionDialog(app *app.App) SessionDialog {
sessionItems = append(sessionItems, sessionItem{session: sess})
}
list := components.NewSimpleList(
list := components.NewListComponent(
sessionItems,
10, // maxVisibleSessions
"No sessions available",