diff options
| author | Paul Buetow <paul@buetow.org> | 2026-03-08 08:59:02 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-03-08 08:59:02 +0200 |
| commit | 77b993ded6e8cfa15e053a09ef79581afd0b7e4b (patch) | |
| tree | d72b0a66152bfb2fd9404f47101fe7159ada33fb /internal/tui/dashboard/bubbles.go | |
| parent | 9950c77981ce06be34e877a6729abb23a36789c6 (diff) | |
dashboard: wire files icicle mode and root path labels
Diffstat (limited to 'internal/tui/dashboard/bubbles.go')
| -rw-r--r-- | internal/tui/dashboard/bubbles.go | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/internal/tui/dashboard/bubbles.go b/internal/tui/dashboard/bubbles.go index 0ec91a9..e6e2909 100644 --- a/internal/tui/dashboard/bubbles.go +++ b/internal/tui/dashboard/bubbles.go @@ -5,7 +5,6 @@ import ( "hash/fnv" "image/color" "math" - "path/filepath" "sort" "strings" "unicode/utf8" @@ -587,6 +586,7 @@ func renderBubbleRow(cells []bubbleCell, palette []color.Color) string { } var b strings.Builder styleCache := make(map[string]lipgloss.Style, 8) + selectedColor := lipgloss.Color("129") for _, cell := range cells { if cell.colorSlot < 0 { if cell.bold { @@ -605,6 +605,9 @@ func renderBubbleRow(cells []bubbleCell, palette []color.Color) string { if !ok { style = lipgloss.NewStyle().Foreground(palette[slot]) if cell.bold { + style = style.Foreground(selectedColor) + } + if cell.bold { style = style.Bold(true) } styleCache[key] = style @@ -795,15 +798,11 @@ func filesDirBubbleData(snap *statsengine.Snapshot) []bubbleDatum { dirs := aggregateFilesByDir(snap.Files()) data := make([]bubbleDatum, 0, len(dirs)) for _, dir := range dirs { - label := filepath.Base(dir.Dir) - if label == "." || label == "/" || label == "" { - label = dir.Dir - } totalBytes := dir.BytesRead + dir.BytesWritten detail := fmt.Sprintf("dir %s, files %d, read %s, write %s", dir.Dir, dir.FileCount, formatBytes(float64(dir.BytesRead)), formatBytes(float64(dir.BytesWritten))) data = append(data, bubbleDatum{ ID: dir.Dir, - Label: label, + Label: rootPathLabelFromFSPath(dir.Dir), Count: dir.Accesses, Bytes: totalBytes, Detail: detail, |
