swarm-ui: dropdowns open a themed list of their own instead of the browser's
SelectField and the refresh-interval picker are built on a new Listbox, a select-only combobox: a button that keeps focus and a listbox in the top layer, so it works the same in every current browser, is not clipped by a scrolling ancestor and shows above a modal dialog. Keys, type-ahead and placement are pure functions with tests. required becomes aria-required, as a button has no native form validation.
This commit is contained in:
parent
88053f437c
commit
a2e8a2bda0
1 changed files with 653 additions and 66 deletions
|
|
@ -14,7 +14,7 @@
|
|||
//
|
||||
// `hive` field added because agent creation had no way to record which
|
||||
// hive an agent runs on. `POST /api/agents` now requires it, so the
|
||||
// roster fetched off `GET /api/hives` backs a required select here
|
||||
// roster fetched off `GET /api/hives` backs a required dropdown here
|
||||
// rather than a free-text field — a spawn target has to be one of the
|
||||
// swarm's actual hives, same reasoning `Ident.parse` gets client-side
|
||||
// pattern validation for `name`.
|
||||
|
|
@ -159,8 +159,8 @@ export function CreateAgentForm({
|
|||
setHives(data);
|
||||
// Single-hive swarms are the common case — default it rather than
|
||||
// making the operator pick the only option. Multi-hive swarms get
|
||||
// no default (the placeholder stays selected), so `required` on
|
||||
// the select below forces an explicit choice per mara's scope.
|
||||
// no default (the placeholder stays selected), so the identity step
|
||||
// cannot be left until one is picked (`stepProblem`), per mara's scope.
|
||||
if (data.length === 1) setHive(data[0].name);
|
||||
})().catch((e: unknown) => setHivesError({ detail: String(e) }));
|
||||
}, []);
|
||||
|
|
|
|||
Loading…
Reference in a new issue