swarm-ui: fix create-agent form field alignment and panel width

TextField and SelectField's shared FormField wrapper had no width of
its own, so inside the form's shrink-to-fit flex column each field's
input/select resolved its 'width: 100%' against its own shrunk
wrapper rather than a shared column width — two fields with
differently-long labels ended up with differently-wide controls.
FormField now caps its own width the same way the control already
does, so every field in a form lines up regardless of label length.

Also wrapped the page in a max-width container: Panel has no width
opinion of its own, so it filled the full page column, leaving a lot
of bare panel to the right of the ~16em-wide form.
This commit is contained in:
iris 2026-08-19 14:13:02 +02:00 committed by mara
commit f14fc154cc
3 changed files with 69 additions and 40 deletions

View file

@ -4,7 +4,19 @@
not row: with a second field (hive) added, a row layout put fields of
different natural widths on one baseline and looked misaligned
mara: "make it a col". Reuses the same base16 slots (../theme.css)
every other component draws from. */
every other component draws from.
`.create-agent-page` caps the panel's own width: `Panel` has no width
opinion of its own, so left unconstrained it filled `.shell-body`'s
full 60em column a lot of bare panel to the right of a ~16em-wide
form, the "weird empty space" mara flagged alongside the field
misalignment. 24em roughly matches the fields' own 16em cap
(../ui/form-field/FormField.css) plus the panel's 1em body padding on
each side and a little breathing room, so the panel reads as sized to
its content instead of to the page column. */
.create-agent-page {
max-width: 24em;
}
.create-agent-intro {
margin: 0 0 1.5em;
color: var(--muted);