summaryrefslogtreecommitdiff
path: root/internal/tui/dashboard/pathlabel.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-03-08 08:59:02 +0200
committerPaul Buetow <paul@buetow.org>2026-03-08 08:59:02 +0200
commit77b993ded6e8cfa15e053a09ef79581afd0b7e4b (patch)
treed72b0a66152bfb2fd9404f47101fe7159ada33fb /internal/tui/dashboard/pathlabel.go
parent9950c77981ce06be34e877a6729abb23a36789c6 (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.go17
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
+}