From 476cfb1aa569b42e7bab6cbfd5e548c9e85ee07c Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Thu, 5 Mar 2026 22:49:20 +0200 Subject: task 363: animate flamegraph data refresh transitions --- internal/tui/dashboard/model.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'internal/tui/dashboard') diff --git a/internal/tui/dashboard/model.go b/internal/tui/dashboard/model.go index a1aaf89..7807b31 100644 --- a/internal/tui/dashboard/model.go +++ b/internal/tui/dashboard/model.go @@ -116,8 +116,13 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { if m.activeTab != TabFlame { return m, nil } + var animCmd tea.Cmd if m.liveTrie != nil && !m.flamegraphModel.Paused() && m.liveTrie.Version() != m.flamegraphModel.LastVersion() { m.flamegraphModel.RefreshFromLiveTrie() + animCmd = m.flamegraphModel.AnimationCmd() + } + if animCmd != nil { + return m, tea.Batch(flameTickCmd(), animCmd) } return m, flameTickCmd() case messages.StatsTickMsg: @@ -136,6 +141,11 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { } return m, nil } + if m.activeTab == TabFlame { + next, cmd := m.flamegraphModel.Update(msg) + m.flamegraphModel = next.(flamegraphtui.Model) + return m, cmd + } return m, nil } -- cgit v1.2.3