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:
jb
2026-06-19 12:19:49 -03:00
co-authored by Claude Opus 4.8
parent 3edfaa4ab2
commit 255b4cc299
9 changed files with 433 additions and 56 deletions
+16
View File
@@ -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
}