stepBack moves to the previous phase that needs input. Esc at the first needed phase is a no-op.
()
| 333 | // stepBack moves to the previous phase that needs input. Esc at the |
| 334 | // first needed phase is a no-op. |
| 335 | func (m *launchWizardModel) stepBack() { |
| 336 | switch m.phase { |
| 337 | case phasePickTool: |
| 338 | // no-op |
| 339 | case phasePickEndpoint: |
| 340 | if m.in.Pinned.Tool.Name == "" { |
| 341 | m.needTool = true |
| 342 | m.sel.Tool = tools.Tool{} |
| 343 | } |
| 344 | m.advanceToNextNeededPhase() |
| 345 | case phasePickModel: |
| 346 | // Stepping back from model clears manual-entry state. |
| 347 | m.manualEntry = false |
| 348 | m.manualValue = "" |
| 349 | m.modelErr = nil |
| 350 | if m.in.Pinned.EndpointName == "" { |
| 351 | m.needEndpoint = true |
| 352 | m.sel.EndpointName = "" |
| 353 | m.sel.Endpoint = providers.Endpoint{} |
| 354 | } |
| 355 | m.advanceToNextNeededPhase() |
| 356 | } |
| 357 | } |
| 358 | |
| 359 | func (m launchWizardModel) updateManualEntry(key tea.KeyMsg) (tea.Model, tea.Cmd) { |
| 360 | switch key.String() { |
no test coverage detected