diff options
| author | Paul Buetow <paul@buetow.org> | 2026-03-08 11:26:11 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-03-08 11:26:11 +0200 |
| commit | f903279e8a872cd7c417f2f57bf306bfb3f3cb87 (patch) | |
| tree | 03f68465d68cee8919f45f90c6cbc2ebde2a9b17 /internal/tui/dashboard/model.go | |
| parent | 9cbf9ec8e9eac92431b9a742c1b625888cb69dfa (diff) | |
dashboard: clamp icicle selection by rendered tile count
Diffstat (limited to 'internal/tui/dashboard/model.go')
| -rw-r--r-- | internal/tui/dashboard/model.go | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/internal/tui/dashboard/model.go b/internal/tui/dashboard/model.go index e496776..a7d415d 100644 --- a/internal/tui/dashboard/model.go +++ b/internal/tui/dashboard/model.go @@ -219,7 +219,7 @@ func (m Model) handleStatsTick(msg messages.StatsTickMsg) (tea.Model, tea.Cmd) { m.syscallsOffset = clampOffset(m.syscallsOffset, m.maxSyscallsRows()) m.syscallsTreemapSelection = clampOffset(m.syscallsTreemapSelection, m.maxSyscallsRows()) m.filesOffset = clampOffset(m.filesOffset, m.maxFilesRows()) - m.filesDirOffset = clampOffset(m.filesDirOffset, m.maxFilesDirRows()) + m.filesDirOffset = clampOffset(m.filesDirOffset, m.maxFilesDirRowsForMode()) m.processesOffset = clampOffset(m.processesOffset, m.maxProcessesRows()) m.streamModel.Refresh() if m.refreshBubbleData() { @@ -407,7 +407,7 @@ func (m *Model) handleScrollKey(msg tea.KeyPressMsg) (bool, tea.Cmd) { return scrollOffset(keyStr, &m.syscallsOffset, m.maxSyscallsRows()), nil case TabFiles: if m.filesDirGrouped { - return scrollOffset(keyStr, &m.filesDirOffset, m.maxFilesDirRows()), nil + return scrollOffset(keyStr, &m.filesDirOffset, m.maxFilesDirRowsForMode()), nil } return scrollOffset(keyStr, &m.filesOffset, m.maxFilesRows()), nil case TabProcesses: @@ -470,6 +470,14 @@ func (m Model) maxFilesDirRows() int { return len(aggregateFilesByDir(m.latest.Files())) } +func (m Model) maxFilesDirRowsForMode() int { + if m.filesVizMode != tabVizModeIcicle { + return m.maxFilesDirRows() + } + width, height := flameViewport(m.width, m.height, m.showHelp) + return filesIcicleTileCount(m.latest, width, height, m.filesChart.Metric()) +} + func (m Model) maxProcessesRows() int { if m.latest == nil { return 0 |
