diff options
| author | Paul Buetow <paul@buetow.org> | 2026-03-06 19:35:08 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-03-06 19:35:08 +0200 |
| commit | 013e46d7856a604d4890a880b8bbfb4b8c58202b (patch) | |
| tree | f8b100ccd04a30b212f0fe728c91736087c60fc1 /internal/tui/dashboard/model.go | |
| parent | 0b2d40cf7ff9b26bfd020488b537bdfdd6f852ae (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.go | 25 |
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 + } +} |
