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/pathlabel.go | |
| parent | 9950c77981ce06be34e877a6729abb23a36789c6 (diff) | |
dashboard: wire files icicle mode and root path labels
Diffstat (limited to 'internal/tui/dashboard/pathlabel.go')
| -rw-r--r-- | internal/tui/dashboard/pathlabel.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/internal/tui/dashboard/pathlabel.go b/internal/tui/dashboard/pathlabel.go new file mode 100644 index 0000000..4782dc0 --- /dev/null +++ b/internal/tui/dashboard/pathlabel.go @@ -0,0 +1,17 @@ +package dashboard + +import ( + "path/filepath" + "strings" +) + +func rootPathLabelFromFSPath(path string) string { + cleaned := filepath.ToSlash(filepath.Clean(strings.TrimSpace(path))) + if cleaned == "" || cleaned == "." || cleaned == "/" { + return "root" + } + if strings.HasPrefix(cleaned, "/") { + return "root" + cleaned + } + return "root/" + cleaned +} |
