TUI Polish

This commit is contained in:
2026-03-27 19:27:38 -04:00
parent 16ea2e8683
commit c4e6c634d1
13 changed files with 462 additions and 86 deletions

View File

@@ -19,6 +19,7 @@ type DashboardModel struct {
width int
height int
loading bool
stale bool
spinner spinner.Model
meetings []models.Meeting
next *models.Meeting
@@ -108,6 +109,9 @@ func (m DashboardModel) Update(msg tea.Msg) (DashboardModel, tea.Cmd) {
return m, nil
}
m.meetings = msg.meetings
if m.client.LastResponseWasStale() {
m.stale = true
}
now := time.Now()
// First priority: find a meeting that has already started but not yet ended
@@ -144,6 +148,9 @@ func (m DashboardModel) Update(msg tea.Msg) (DashboardModel, tea.Cmd) {
m.loading = false
if msg.err == nil {
m.sessions = msg.sessions
if m.client.LastResponseWasStale() {
m.stale = true
}
}
return m, nil
@@ -152,6 +159,7 @@ func (m DashboardModel) Update(msg tea.Msg) (DashboardModel, tea.Cmd) {
case tea.KeyMsg:
if matchKey(msg, GlobalKeys.Retry) && m.err != nil {
m.err = nil
m.stale = false
m.loading = true
return m, m.Init()
}
@@ -177,6 +185,10 @@ func (m DashboardModel) View() string {
w = 40
}
if m.stale {
sb.WriteString(renderStaleBanner())
}
titleStyle := lipgloss.NewStyle().
Foreground(lipgloss.Color(colorF1Red)).
Bold(true)