Skip to content

feat: wizard Ctrl+C exit with confirmation#39

Merged
hi-lei merged 2 commits intomainfrom
feat/wizard-allow-ctrl-c
Apr 10, 2026
Merged

feat: wizard Ctrl+C exit with confirmation#39
hi-lei merged 2 commits intomainfrom
feat/wizard-allow-ctrl-c

Conversation

@hi-lei
Copy link
Copy Markdown
Collaborator

@hi-lei hi-lei commented Apr 10, 2026

Summary

  • Upgrade verdagostack to v1.3.0 (composite wizard model — single Bubble Tea program for entire wizard)
  • Ctrl+C now properly exits the wizard instead of going back
  • Ctrl+C shows "Exit wizard? [Y/n]" confirmation prompt before exiting (on vm create, template create, auth login)
  • Esc still navigates back one step as before
  • Add clear error message when no GPU/CPU instance types are available

What changed

  • go.mod: verdagostack v1.2.0 → v1.3.0
  • cmd/vm/create.go, cmd/vm/wizard.go, cmd/auth/login.go: add wizard.WithExitConfirmation()
  • cmd/vm/wizard.go: use kindCPU/billingTypeSpot constants, add no-availability error
  • cmd/vm/wizard_cache.go: extract buildInstanceTypeChoices() (lint fix)
  • cmd/auth/wizard_test.go, cmd/vm/wizard_test.go: use wizard.WithTestResults() for composite model

Test plan

  • verda vm create — Ctrl+C on any step shows "Exit wizard?" confirm
  • verda vm create — Esc goes back one step
  • verda vm create — Confirm Y exits, N stays on current step
  • verda template create — same Ctrl+C behavior
  • verda auth login — same Ctrl+C behavior
  • verda settings theme — Ctrl+C exits silently (no confirmation)
  • Terminal is clean after wizard exit (no raw mode artifacts)
  • make pre-commit passes

🤖 Generated with Claude Code

hi-lei and others added 2 commits April 10, 2026 14:48
Upgrade to verdagostack v1.3.0 which introduces the composite wizard
model — a single Bubble Tea program runs for the entire wizard lifetime
instead of creating separate programs per prompt. This enables proper
Ctrl+C handling via key bindings intercepted at the composite level.

Changes:
- Upgrade verdagostack dependency from v1.2.0 to v1.3.0
- Enable WithExitConfirmation() on vm create, template create, and
  auth login wizards (Ctrl+C shows "Exit wizard?" confirm prompt)
- Update wizard tests to use WithTestResults() instead of the old
  tui/testing.Prompter (composite model uses result channels)
- Extract buildInstanceTypeChoices() to reduce cyclomatic complexity
- Add kindCPU constant, use billingTypeSpot constant consistently
- Add clear error message when no instance types are available

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@hi-lei hi-lei merged commit 820fa11 into main Apr 10, 2026
12 checks passed
@hi-lei hi-lei deleted the feat/wizard-allow-ctrl-c branch April 10, 2026 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant