From 013e46d7856a604d4890a880b8bbfb4b8c58202b Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Fri, 6 Mar 2026 19:35:08 +0200 Subject: feat(tui): add flamegraph click lineage undo and scope quit key --- internal/tui/dashboard/model.go | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'internal/tui/dashboard/model.go') diff --git a/internal/tui/dashboard/model.go b/internal/tui/dashboard/model.go index aae98b1..fb509b0 100644 --- a/internal/tui/dashboard/model.go +++ b/internal/tui/dashboard/model.go @@ -214,7 +214,7 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { return m, nil } if m.activeTab == TabFlame { - next, cmd := m.flamegraphModel.Update(msg) + next, cmd := m.flamegraphModel.Update(translateFlamegraphMsg(msg)) m.flamegraphModel = next.(flamegraphtui.Model) return m, cmd } @@ -835,3 +835,26 @@ func flameViewport(width, height int, showHelp bool) (int, int) { } return width, height } + +func translateFlamegraphMsg(msg tea.Msg) tea.Msg { + switch mouse := msg.(type) { + case tea.MouseClickMsg: + m := mouse.Mouse() + m.Y -= dashboardTabBarRows + return tea.MouseClickMsg(m) + case tea.MouseReleaseMsg: + m := mouse.Mouse() + m.Y -= dashboardTabBarRows + return tea.MouseReleaseMsg(m) + case tea.MouseMotionMsg: + m := mouse.Mouse() + m.Y -= dashboardTabBarRows + return tea.MouseMotionMsg(m) + case tea.MouseWheelMsg: + m := mouse.Mouse() + m.Y -= dashboardTabBarRows + return tea.MouseWheelMsg(m) + default: + return msg + } +} -- cgit v1.2.3