diff options
| author | Paul Buetow <paul@buetow.org> | 2026-03-05 22:18:08 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-03-05 22:18:08 +0200 |
| commit | 043bbbb884560a0f91f5e12d0b7851ad60121d5a (patch) | |
| tree | b3345068b594945c777991a03876e2826175c089 /internal/tui/common | |
| parent | 98e46348ca59de2033451b844a4f592f1f9e5433 (diff) | |
task 350: add TabFlame tab infrastructure
Diffstat (limited to 'internal/tui/common')
| -rw-r--r-- | internal/tui/common/keys.go | 5 | ||||
| -rw-r--r-- | internal/tui/common/keys_test.go | 24 |
2 files changed, 27 insertions, 2 deletions
diff --git a/internal/tui/common/keys.go b/internal/tui/common/keys.go index 31fdf64..6b0ae27 100644 --- a/internal/tui/common/keys.go +++ b/internal/tui/common/keys.go @@ -44,7 +44,7 @@ func DefaultKeyMap() KeyMap { Four: key.NewBinding(key.WithKeys("4"), key.WithHelp("4", "processes")), Five: key.NewBinding(key.WithKeys("5"), key.WithHelp("5", "lat+gaps")), Six: key.NewBinding(key.WithKeys("6"), key.WithHelp("6", "stream")), - Seven: key.NewBinding(key.WithKeys("7"), key.WithHelp("7", "stream")), + Seven: key.NewBinding(key.WithKeys("7"), key.WithHelp("7", "flame")), DirGroup: key.NewBinding(key.WithKeys("d"), key.WithHelp("d", "dir group")), SelectPID: key.NewBinding(key.WithKeys("p"), key.WithHelp("p", "select pid")), SelectTID: key.NewBinding(key.WithKeys("t"), key.WithHelp("t", "select tid")), @@ -83,6 +83,7 @@ func (k KeyMap) DashboardStatusHelpSections() []HelpSection { k.Four, k.Five, k.Six, + k.Seven, k.SelectPID, k.SelectTID, k.Probes, @@ -126,7 +127,7 @@ func (k KeyMap) DashboardFullHelp() [][]key.Binding { controls = append(controls, k.DirGroup, k.SelectPID, k.SelectTID, k.Probes, k.Refresh, k.Quit) return [][]key.Binding{ - {k.One, k.Two, k.Three, k.Four, k.Five, k.Six}, + {k.One, k.Two, k.Three, k.Four, k.Five, k.Six, k.Seven}, controls, { helpTextBinding("space", "stream pause"), diff --git a/internal/tui/common/keys_test.go b/internal/tui/common/keys_test.go index 42e47ab..e043f9e 100644 --- a/internal/tui/common/keys_test.go +++ b/internal/tui/common/keys_test.go @@ -23,6 +23,11 @@ func TestDefaultKeyMapIncludesDirGroupBinding(t *testing.T) { if selectTIDHelp.Key != "t" || selectTIDHelp.Desc != "select tid" { t.Fatalf("unexpected select tid binding help: key=%q desc=%q", selectTIDHelp.Key, selectTIDHelp.Desc) } + + flameHelp := keys.Seven.Help() + if flameHelp.Key != "7" || flameHelp.Desc != "flame" { + t.Fatalf("unexpected flame binding help: key=%q desc=%q", flameHelp.Key, flameHelp.Desc) + } } func TestDashboardFullHelpIncludesDirGroupBinding(t *testing.T) { @@ -33,6 +38,7 @@ func TestDashboardFullHelpIncludesDirGroupBinding(t *testing.T) { } found := false + foundSeven := false for _, binding := range groups[1] { help := binding.Help() if help.Key == "d" && help.Desc == "dir group" { @@ -44,6 +50,17 @@ func TestDashboardFullHelpIncludesDirGroupBinding(t *testing.T) { t.Fatalf("expected dir group binding in dashboard full help controls") } + for _, binding := range groups[0] { + help := binding.Help() + if help.Key == "7" && help.Desc == "flame" { + foundSeven = true + break + } + } + if !foundSeven { + t.Fatalf("expected flame tab binding in dashboard full help tabs") + } + found = false for _, binding := range groups[1] { help := binding.Help() @@ -86,6 +103,7 @@ func TestDashboardStatusHelpIncludesProbesBinding(t *testing.T) { short := keys.DashboardStatusHelp() found := false foundSelectTID := false + foundSeven := false for _, binding := range short { help := binding.Help() if help.Key == "o" && help.Desc == "probes" { @@ -94,6 +112,9 @@ func TestDashboardStatusHelpIncludesProbesBinding(t *testing.T) { if help.Key == "t" && help.Desc == "select tid" { foundSelectTID = true } + if help.Key == "7" && help.Desc == "flame" { + foundSeven = true + } } if !found { t.Fatalf("expected probes binding in dashboard short help") @@ -101,4 +122,7 @@ func TestDashboardStatusHelpIncludesProbesBinding(t *testing.T) { if !foundSelectTID { t.Fatalf("expected select tid binding in dashboard short help") } + if !foundSeven { + t.Fatalf("expected flame tab binding in dashboard short help") + } } |
