diff --git a/frontend/packages/swarm-ui/src/pages/CreateAgentPage.css b/frontend/packages/swarm-ui/src/pages/CreateAgentPage.css index 394ad05c..b551351c 100644 --- a/frontend/packages/swarm-ui/src/pages/CreateAgentPage.css +++ b/frontend/packages/swarm-ui/src/pages/CreateAgentPage.css @@ -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); diff --git a/frontend/packages/swarm-ui/src/pages/CreateAgentPage.tsx b/frontend/packages/swarm-ui/src/pages/CreateAgentPage.tsx index 7bb605b2..fb2dd464 100644 --- a/frontend/packages/swarm-ui/src/pages/CreateAgentPage.tsx +++ b/frontend/packages/swarm-ui/src/pages/CreateAgentPage.tsx @@ -125,44 +125,48 @@ export function CreateAgentPage() { } return ( - -

- Create a new agent's swarm-level identity. This only queues the job — check{' '} - jobs to watch it settle. -

- {hivesError && } -
- - - - - {result.status === 'done' && ( -

- queued as job node #{result.nodeId} — watch it in jobs +

+ +

+ Create a new agent's swarm-level identity. This only queues the job — check{' '} + jobs to watch it settle.

- )} - {result.status === 'error' && ( - - )} -
+ {hivesError && } +
+ + + + + {result.status === 'done' && ( +

+ queued as job node #{result.nodeId} — watch it in jobs +

+ )} + {result.status === 'error' && ( + + )} + +
); } diff --git a/frontend/packages/swarm-ui/src/ui/form-field/FormField.css b/frontend/packages/swarm-ui/src/ui/form-field/FormField.css index 29257bdd..a2365e9a 100644 --- a/frontend/packages/swarm-ui/src/ui/form-field/FormField.css +++ b/frontend/packages/swarm-ui/src/ui/form-field/FormField.css @@ -8,11 +8,24 @@ every control in the kit whether or not it's ever used on a touch device, since the alternative is a component that behaves differently per input method. Colours are the shared base16-derived vars - (../../theme.css), never literal. */ + (../../theme.css), never literal. + + The field wrapper repeats `.ui-form-control`'s own `width: 100%; + max-width: 16em` rather than leaving the wrapper unconstrained: inside + a shrink-to-fit flex column (`CreateAgentPage`'s form is one), an + unconstrained wrapper sizes to its own content — and a `width: 100%` + *control* inside an auto-width wrapper resolves against that shrunk + width, not the intended 16em cap, so two fields with differently-long + labels ("agent name" vs "hive") ended up with differently-wide inputs — + the misalignment mara reported on the create-agent page. Matching the + two declarations here means every field's control width is driven by + the same fixed cap regardless of its label's length or its siblings'. */ .ui-form-field { display: flex; flex-direction: column; gap: 0.3em; + width: 100%; + max-width: 16em; } .ui-form-field-label { font-size: 0.85em;