File tree Expand file tree Collapse file tree 3 files changed +31
-5
lines changed
Expand file tree Collapse file tree 3 files changed +31
-5
lines changed Original file line number Diff line number Diff line change @@ -159,6 +159,32 @@ func (m *Model) DisableAllInSection() {
159159 }
160160}
161161
162+ // EnableAllModels enables all models in both external and transformation sections.
163+ func (m * Model ) EnableAllModels () {
164+ for i := range m .externalModels {
165+ m .externalModels [i ].Enabled = true
166+ }
167+
168+ for i := range m .transformationModels {
169+ m .transformationModels [i ].Enabled = true
170+ }
171+
172+ m .dirty = true
173+ }
174+
175+ // DisableAllModels disables all models in both external and transformation sections.
176+ func (m * Model ) DisableAllModels () {
177+ for i := range m .externalModels {
178+ m .externalModels [i ].Enabled = false
179+ }
180+
181+ for i := range m .transformationModels {
182+ m .transformationModels [i ].Enabled = false
183+ }
184+
185+ m .dirty = true
186+ }
187+
162188// GetSectionLength returns the number of items in the current section.
163189func (m * Model ) GetSectionLength () int {
164190 switch m .activeSection {
Original file line number Diff line number Diff line change @@ -85,16 +85,16 @@ func (m Model) handleKeyPress(msg tea.KeyMsg) (tea.Model, tea.Cmd) {
8585
8686 case "a" :
8787 if m .activeSection != sectionEnv {
88- m .EnableAllInSection ()
89- m .statusMsg = "Enabled all models in section "
88+ m .EnableAllModels ()
89+ m .statusMsg = "Enabled all models"
9090
9191 return m , nil
9292 }
9393
9494 case "n" :
9595 if m .activeSection != sectionEnv {
96- m .DisableAllInSection ()
97- m .statusMsg = "Disabled all models in section "
96+ m .DisableAllModels ()
97+ m .statusMsg = "Disabled all models"
9898
9999 return m , nil
100100 }
Original file line number Diff line number Diff line change @@ -315,7 +315,7 @@ func (m Model) renderHelp() string {
315315 case sectionEnv :
316316 help = "[←/→] Switch section [↑/↓] Navigate [0-9] Type value [Backspace] Delete [s] Save [q] Quit"
317317 default :
318- help = "[←/→] Switch section [↑/↓] Navigate [Space] Toggle [a] All on [n] All off [d] Enable deps [s] Save [q] Quit"
318+ help = "[←/→] Switch section [↑/↓] Navigate [Space] Toggle [a] Enable all [n] Disable all [d] Enable deps [s] Save [q] Quit"
319319 }
320320 }
321321
You can’t perform that action at this time.
0 commit comments