diff --git a/pkg/configtui/model.go b/pkg/configtui/model.go index d28493e..2161851 100644 --- a/pkg/configtui/model.go +++ b/pkg/configtui/model.go @@ -159,6 +159,32 @@ func (m *Model) DisableAllInSection() { } } +// EnableAllModels enables all models in both external and transformation sections. +func (m *Model) EnableAllModels() { + for i := range m.externalModels { + m.externalModels[i].Enabled = true + } + + for i := range m.transformationModels { + m.transformationModels[i].Enabled = true + } + + m.dirty = true +} + +// DisableAllModels disables all models in both external and transformation sections. +func (m *Model) DisableAllModels() { + for i := range m.externalModels { + m.externalModels[i].Enabled = false + } + + for i := range m.transformationModels { + m.transformationModels[i].Enabled = false + } + + m.dirty = true +} + // GetSectionLength returns the number of items in the current section. func (m *Model) GetSectionLength() int { switch m.activeSection { diff --git a/pkg/configtui/update.go b/pkg/configtui/update.go index 328845c..9830e14 100644 --- a/pkg/configtui/update.go +++ b/pkg/configtui/update.go @@ -85,16 +85,16 @@ func (m Model) handleKeyPress(msg tea.KeyMsg) (tea.Model, tea.Cmd) { case "a": if m.activeSection != sectionEnv { - m.EnableAllInSection() - m.statusMsg = "Enabled all models in section" + m.EnableAllModels() + m.statusMsg = "Enabled all models" return m, nil } case "n": if m.activeSection != sectionEnv { - m.DisableAllInSection() - m.statusMsg = "Disabled all models in section" + m.DisableAllModels() + m.statusMsg = "Disabled all models" return m, nil } diff --git a/pkg/configtui/view.go b/pkg/configtui/view.go index 657c61b..7f1b0f0 100644 --- a/pkg/configtui/view.go +++ b/pkg/configtui/view.go @@ -315,7 +315,7 @@ func (m Model) renderHelp() string { case sectionEnv: help = "[←/→] Switch section [↑/↓] Navigate [0-9] Type value [Backspace] Delete [s] Save [q] Quit" default: - help = "[←/→] Switch section [↑/↓] Navigate [Space] Toggle [a] All on [n] All off [d] Enable deps [s] Save [q] Quit" + help = "[←/→] Switch section [↑/↓] Navigate [Space] Toggle [a] Enable all [n] Disable all [d] Enable deps [s] Save [q] Quit" } }