Expand description
Modal forms — reusable scaffolding for multi-field option-settings
editors. The first concrete consumer is :capacity (MinSize / MaxSize /
InstanceType / Cooldown); the Network / Security pickers will follow
once we add a multi-select field kind.
Each Form carries its own field list, cursor position, and lifecycle
state. Field values are always stored as String regardless of kind —
FieldKind tells the renderer + input handler how to interpret them.
Submission converts the field values into (namespace, option_name, value) triples and dispatches via the shared
spawn_option_settings_update helper.
Structs§
- Form
- One modal-form session. Owned by the [
App] whilecrate::app::Mode::Formis active; replaced wholesale on a new:commandthat opens a form. - Form
Field
Enums§
- Field
Kind - Form
State - Form
Submit - What the form does on submit.
Functions§
- is_
multi_ selected - Pure: is
optcurrently selected in a comma-separated multi-select value? Trims options on both sides so whitespace variations don’t produce a false negative. - parse_
multi_ value - Pure: parse a comma-separated multi-select value into a vec of
trimmed, non-empty option strings. Round-trip with
join(","). - toggle_
multi - Pure: toggle
optin a comma-separated multi-select value. Returns the new comma-joined string. Preserves the original order of options that were already selected and appends a newly-added one at the end. - validate_
field - Pure: returns
Ok(())ifvalueis acceptable forkind, else the human-readable error to render below the field.