Repository navigation
feat(instances): a new VM is made on one form in three steps - #172
Merged
Merged
Conversation
The create page had three tabs (flavor, custom, template), each with its own copy of the same create form; every flavor rendered one more copy in a dialog, and fixes had to be made in each copy. All of them posted the same form to the same job, differing only in where the disk comes from. The page is now one form in sections: name and size, disk, networks and an Advanced section. The disk section offers three sources as radio cards (a new disk, existing volumes, a copy of a template); only the chosen source's fields are shown, and the others are disabled, so they are neither sent nor validated. A template's copy goes into the template's pool unless another is picked. Flavors are presets that fill vCPU, memory and disk size and pick a new disk; they are added and deleted in a dialog outside the form. Every source uses the per-interface network rows, so a new disk no longer requires a MAC: libvirt gives an interface without one its address, as it did for the other sources. A refused form comes back with its source, volumes, template and networks, and the focus on its first error. Without a storage pool or a network the page shows why instead of the form, and a host that cannot be read is a message, not a 500. The host dialog and the machine page share the form's look: hosts are rows with their CPU and memory use, the machine page is a card with Cancel/Next and the XML way is a collapsible section. All three steps show the same step indicator, done steps linking back. The create job refuses more than one disk source (the page sends one; a crafted request could send two, and the job would have used the first). A field with help text is described by its help and its error. Frontend review fixes: the presets and the disclosure buttons show a focus ring for keyboard users; a disclosure spans its card and its chevron turns while open; a preset says it picks a new disk; numeric fields bring a numeric keyboard and MAC fields no autocorrection; the machine page's Next waits for a machine type. Tom Select's control keeps the text colour of the select it replaces: its own fixed colour made typed text invisible on dark Bootswatch themes, on every page that uses it.
catborise
force-pushed
the
create-vm-single-form
branch
from
October 23, 2026 20:09
ab116b9 to
b5d9c07
Compare
This was referenced Oct 23, 2026
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.
This closes U-06, the "wizard consolidation" item on the roadmap. The design was discussed with Codex and agy, and you reviewed it as a spike before this PR.
What changes for the user
The template is 617 lines instead of 1112. Overall the diff removes about 480 lines.
Server side
error_attrstakes an optional help id, so a field is described by both its help text and its error.Verification
Full suite on SQLite and on PostgreSQL 16: 1387 tests each, OK (32 skipped).
ruff check .is clean.The page's scripts are tested in Node:
axe-core 4.10.3 checked the host dialog, the machine page (with the XML section open) and the details page (each disk source, with presets, Advanced and the flavor dialog open).
Live test on a Vagrant compute: one VM created with each disk source.
audit-new.qcow2.audit-tpl.img.audit-ext.qcow2.Each VM had the right disk and one NIC with a random MAC. All three VMs and their volumes were removed afterwards.
An independent review found nothing critical. Its two important findings (the template's copy pool, missing restore tests) and most minor ones are fixed here.
Left for later (minor): if the machine types fail to load, Next stays disabled without a message; when every host is offline, the host dialog shows an empty list.
Frontend review (Codex, as a frontend/UX/a11y specialist, with screenshots)
Codex reviewed the whole branch. Applied here:
focus-ring); before, keyboard users had no visible focus on them.webvirtcloud.css, so it covers every page that uses Tom Select.The full suite passes again on SQLite and on PostgreSQL (1388 tests each). The axe scan is still clean on bootstrap-orj and darkly.
Larger points from the review are separate issues: #173 (managing flavors discards the form), #174 (XML lost on refusal), #175 (no minimum for vCPU/memory), #176 (empty host dialog when all hosts are offline), #177 (stale dependent selects).
🤖 Generated with Claude Code