summaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-02-25 10:23:16 +0200
committerPaul Buetow <paul@buetow.org>2026-02-25 10:23:16 +0200
commit1a094b919cf66c2c3643e621c0c0af3bf1c90fd9 (patch)
tree52b3d4bd0fa74fa76a4bd90fbf72bf38bcfbc536 /internal
parentf7bece71b79ffc492917d80ce27b4a911c98dcfd (diff)
Toggle files directory grouping with d key
Diffstat (limited to 'internal')
-rw-r--r--internal/tui/dashboard/model.go5
-rw-r--r--internal/tui/dashboard/model_test.go18
2 files changed, 23 insertions, 0 deletions
diff --git a/internal/tui/dashboard/model.go b/internal/tui/dashboard/model.go
index 822f88f..1a770f3 100644
--- a/internal/tui/dashboard/model.go
+++ b/internal/tui/dashboard/model.go
@@ -138,6 +138,11 @@ func (m Model) handleKey(msg tea.KeyMsg) (tea.Model, tea.Cmd) {
snap := m.snapshot()
cmd = func() tea.Msg { return messages.StatsTickMsg{Snap: snap} }
handled = true
+ case key.Matches(msg, m.keys.DirGroup):
+ if m.activeTab == TabFiles {
+ m.filesDirGrouped = !m.filesDirGrouped
+ handled = true
+ }
}
}
if !handled {
diff --git a/internal/tui/dashboard/model_test.go b/internal/tui/dashboard/model_test.go
index 29b698d..1f479ab 100644
--- a/internal/tui/dashboard/model_test.go
+++ b/internal/tui/dashboard/model_test.go
@@ -140,6 +140,24 @@ func TestFilesTabScrollsWithJK(t *testing.T) {
}
}
+func TestDirGroupKeyTogglesOnlyOnFilesTab(t *testing.T) {
+ m := NewModelWithConfig(nil, nil, 250, common.DefaultKeyMap())
+ m.activeTab = TabFiles
+
+ next, _ := m.Update(tea.KeyMsg{Type: tea.KeyRunes, Runes: []rune{'d'}})
+ model := next.(Model)
+ if !model.filesDirGrouped {
+ t.Fatalf("expected filesDirGrouped to toggle on files tab")
+ }
+
+ model.activeTab = TabOverview
+ next, _ = model.Update(tea.KeyMsg{Type: tea.KeyRunes, Runes: []rune{'d'}})
+ model = next.(Model)
+ if !model.filesDirGrouped {
+ t.Fatalf("expected filesDirGrouped unchanged outside files tab")
+ }
+}
+
func TestScrollOffsetDoesNotGrowUnbounded(t *testing.T) {
m := NewModelWithConfig(nil, nil, 250, common.DefaultKeyMap())
m.activeTab = TabSyscalls