From 07dc1db3180d86b5b6fc61563c0a5004098e26cc Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Fri, 6 Mar 2026 08:22:17 +0200 Subject: Start flame ticks on dashboard entry and use purple selection --- internal/tui/dashboard/model.go | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'internal/tui/dashboard') 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 } -- cgit v1.2.3