diff options
| author | Paul Buetow <paul@buetow.org> | 2026-02-24 17:27:10 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-02-24 17:27:10 +0200 |
| commit | da8ddf1cf415f1754c3fe71f3f342327ad00e91e (patch) | |
| tree | af3ba70015cf7db4bfd3a2adcb9334417740e4f3 /internal/tui/common | |
| parent | 2ae0b33c9f196634eaa55bd6997d1feae9147385 (diff) | |
tui: add toggle to disable snapshot export file writes
Diffstat (limited to 'internal/tui/common')
| -rw-r--r-- | internal/tui/common/keys.go | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/internal/tui/common/keys.go b/internal/tui/common/keys.go index 0f9c54d..1111def 100644 --- a/internal/tui/common/keys.go +++ b/internal/tui/common/keys.go @@ -45,14 +45,25 @@ func DefaultKeyMap() KeyMap { // DashboardShortHelp returns compact bindings for dashboard help bars. func (k KeyMap) DashboardShortHelp() []key.Binding { - return []key.Binding{k.Tab, k.ShiftTab, k.Export, k.Help, k.Quit} + bindings := []key.Binding{k.Tab, k.ShiftTab} + if help := k.Export.Help(); help.Key != "" || help.Desc != "" { + bindings = append(bindings, k.Export) + } + bindings = append(bindings, k.Help, k.Quit) + return bindings } // DashboardFullHelp returns grouped bindings for dashboard overlays. func (k KeyMap) DashboardFullHelp() [][]key.Binding { + controls := []key.Binding{k.Tab, k.ShiftTab} + if help := k.Export.Help(); help.Key != "" || help.Desc != "" { + controls = append(controls, k.Export) + } + controls = append(controls, k.Refresh, k.Help, k.Quit) + return [][]key.Binding{ {k.One, k.Two, k.Three, k.Four, k.Five, k.Six}, - {k.Tab, k.ShiftTab, k.Export, k.Refresh, k.Help, k.Quit}, + controls, { key.NewBinding(key.WithKeys("left/right"), key.WithHelp("left/right", "tab")), key.NewBinding(key.WithKeys("h/l"), key.WithHelp("h/l", "tab")), |
