summaryrefslogtreecommitdiff
path: root/internal/tui/dashboard
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-03-06 08:22:17 +0200
committerPaul Buetow <paul@buetow.org>2026-03-06 08:22:17 +0200
commit07dc1db3180d86b5b6fc61563c0a5004098e26cc (patch)
tree6f452534388bd901c7f91d9959126d73cc4ee636 /internal/tui/dashboard
parent4445eefb69a50d178d4c6bd02fd534312d774542 (diff)
Start flame ticks on dashboard entry and use purple selection
Diffstat (limited to 'internal/tui/dashboard')
-rw-r--r--internal/tui/dashboard/model.go18
1 files changed, 17 insertions, 1 deletions
diff --git a/internal/tui/dashboard/model.go b/internal/tui/dashboard/model.go
index 4cf7c15..ebd0c03 100644
--- a/internal/tui/dashboard/model.go
+++ b/internal/tui/dashboard/model.go
@@ -85,7 +85,17 @@ func NewModelWithConfig(engine SnapshotSource, streamSource *eventstream.RingBuf
// Init starts periodic refresh ticks.
func (m Model) Init() tea.Cmd {
- return tickCmd(m.refreshEvery)
+ cmds := []tea.Cmd{tickCmd(m.refreshEvery)}
+ switch m.activeTab {
+ case TabStream:
+ cmds = append(cmds, streamTickCmd())
+ case TabFlame:
+ cmds = append(cmds, flameTickCmd())
+ }
+ if len(cmds) == 1 {
+ return cmds[0]
+ }
+ return tea.Batch(cmds...)
}
// Update handles ticks, snapshots, tab changes, and resize events.
@@ -108,12 +118,18 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
func() tea.Msg { return messages.StatsTickMsg{Snap: snap} },
)
case streamTickMsg:
+ if !m.focused {
+ return m, nil
+ }
if m.activeTab != TabStream {
return m, nil
}
m.streamModel.Refresh()
return m, streamTickCmd()
case flameTickMsg:
+ if !m.focused {
+ return m, nil
+ }
if m.activeTab != TabFlame {
return m, nil
}