feat: add back navigation, review step, and error retry to TUI
Implements three UX improvements (TODO #1–#3): - Back navigation: Esc returns to the previous input step. The Model keeps a history stack of input steps (advance/goBack helpers); action/wait steps are excluded via isInputStep so back never re-enters a side-effecting step. Form values are preserved. - Review step (StepReview): shows all collected config for confirmation before any file is written; Enter installs, Esc edits. - Retry vs. fix: transient failures (image pull, container run) offer "r: tentar novamente" instead of quitting; validation failures route back to the relevant form to correct the value. Adds nav_test.go for the history/navigation logic and updates README/CLAUDE/docs (incl. docs/TODO.md tracking the remaining ideas). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -24,8 +24,24 @@ const (
|
||||
StepDatabaseConfig
|
||||
StepCertConfig
|
||||
|
||||
// Review
|
||||
StepReview
|
||||
|
||||
// Finalizing
|
||||
StepGenerateFile
|
||||
StepRunDocker
|
||||
StepDone
|
||||
)
|
||||
|
||||
// isInputStep reports whether a step collects user input and therefore participates
|
||||
// in back navigation. Action/wait steps (downloads, file generation, container runs)
|
||||
// are excluded so that "back" never re-enters a side-effecting step.
|
||||
func isInputStep(s step) bool {
|
||||
switch s {
|
||||
case StepDockerLogin, StepIPQuestion, StepWireguardConfig,
|
||||
StepAppConfig, StepServerConfig, StepDatabaseConfig,
|
||||
StepCertConfig, StepReview:
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user