diff options
| author | Paul Buetow <paul@buetow.org> | 2026-03-05 22:49:20 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-03-05 22:49:20 +0200 |
| commit | 476cfb1aa569b42e7bab6cbfd5e548c9e85ee07c (patch) | |
| tree | 74c2a854955e24ff1dd638b4cfd8a0120b576cc4 /internal/tui/dashboard | |
| parent | fd75c310b7571a48db9135360d99a331638721bc (diff) | |
task 363: animate flamegraph data refresh transitions
Diffstat (limited to 'internal/tui/dashboard')
| -rw-r--r-- | internal/tui/dashboard/model.go | 10 |
1 files changed, 10 insertions, 0 deletions
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 } |
