fix(vm): don't offer "None (skip)" after queuing storage volumes - #56
Merged
Conversation
The storage wizard step keeps queued volumes in local vars, flushed to opts only via "Done". But buildStorageChoices kept "None (skip)" at row 0 even after the user added a volume; re-prompt rests the cursor on row 0, so one Enter silently discarded every queued volume — nothing in the summary, nothing created, nothing attached (fixes #54). Skip is now only offered on the fresh storage menu; with volumes queued the options are add-more/Done, and Esc still aborts (the loader resets on re-entry for a fresh pass). Regression tests: choices-level (skip absent once queued) and loader-level (add -> Done flushes specs; fresh skip leaves storage empty). Verified the choices test fails on the pre-fix code.
hi-lei
force-pushed
the
fix/vm-wizard-storage-skip
branch
from
August 9, 2026 09:36
b12982a to
3a3d4d2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #54.
Root cause
The storage step of
vm create's wizard loops to collect volumes into local vars (wizard.go), flushed toopts.VolumeSpecs/ExistingVolumesonly via theDonebranch. ButbuildStorageChoiceskeptNone (skip)at row 0 even after the user had queued a volume — and the re-prompt rests the cursor on row 0. So one Enter on the second prompt hit thecase ""branch, which nils out the opts and drops the locals: the volume never appears in the summary, is never created, never attached.Downstream was fine:
Done→opts.VolumeSpecs→ summary (wizard_summary.go) →parseVolumeSpecs(create.go) all work; only the silent-discard path was broken.Fix
None (skip)is now only offered on the fresh storage menu. Once volumes are queued the menu is add-more/Done — quitting is still possible via Esc (re-entering the step resets for a fresh pass).Tests
buildStorageChoices: skip absent once a new/existing volume is queued; Done present (verified to fail on pre-fix code)VolumeSpecs; fresh skip leaves storage emptyTest plan
make build,make lint, package tests (pre-commit hooks incl. golangci-lint all pass)Note
Independent of #55 (overlap is just import lines in
wizard.go/wizard_subflows.go— clean merge either way). Suggest shipping this first as a patch release; dismissed volume intent is a bad silent failure in v1.7.2.