summaryrefslogtreecommitdiff
path: root/internal/tui/dashboard/model.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-03-06 19:35:08 +0200
committerPaul Buetow <paul@buetow.org>2026-03-06 19:35:08 +0200
commit013e46d7856a604d4890a880b8bbfb4b8c58202b (patch)
treef8b100ccd04a30b212f0fe728c91736087c60fc1 /internal/tui/dashboard/model.go
parent0b2d40cf7ff9b26bfd020488b537bdfdd6f852ae (diff)
feat(tui): add flamegraph click lineage undo and scope quit key
Diffstat (limited to 'internal/tui/dashboard/model.go')
-rw-r--r--internal/tui/dashboard/model.go25
1 files changed, 24 insertions, 1 deletions
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
+ }
+}