Skip to main content

Module model

Module model 

Source
Expand description

The administration app’s model (docs/design/admin-forms.md): a declarative form tree for everything an application shows that is not its work surface (settings, tools, tasks).

Experimental: may change in any release (docs/stability.md).

A component never draws its own widgets: it declares a Manifest (scopes, sections, groups and their items: fields, actions, statuses, callouts) and the framework renders it with a closed set of bricks. Manifests are data with names: Rust builders produce them and they serialise to JSON, so an out-of-process plugin can send one and an agent can read one. Hooks are named here and registered in Rust (hooks); they compute, they never draw.

  • Manifest: a versioned contribution, checked (Manifest::check) and merged into a Tree;
  • generate: the pages of today’s settings, from their descriptors, with no hand-written page;
  • layers: the value scopes a field may be set in (app, library, workspace, and the run’s overrides, shown, never edited);
  • template: an action’s argument template (${field});
  • wizard: the wizard kit, declared steps (each a form over a draft) with their validation, a summary and a command run on finish.

Modules§

generate
The pages of today’s settings, generated from their declarations: a scope from the setting id’s prefix (appearance.* to Interface, input.* to Input, developer.* to Developer, the rest to General), a section per settings section (the owner’s title, or an alter hook’s), a field per setting. No hand-written page.
hooks
Form hooks: Rust functions registered by name and named by a manifest (super::FieldHooks, super::Action::confirm, super::StatusSource::Hook). They compute; they never draw.
layers
Value scopes: where a setting’s value is set. app is this person on this machine (the settings store, as today) and the only scope a setting has unless it opts into more; the host application declares its own scopes above app (a project, a library, a workspace…), each later one winning over the earlier ones; run is the command line’s overrides, above them all, shown, never edited.
template
An action’s argument template: a JSON value whose strings may name a form’s values. A string that is exactly ${name} becomes that value (any JSON); ${name} inside a longer string is replaced by its text. ${row.<key>} and ${selection} are names like any other: the caller puts them in the values.
transfer
Settings export and import: the file a person writes their settings to and reads them back from, and the plan an import shows before it applies (one row per setting: what it is now, what the file says, and whether it would change, stay, or be left out and why).
wizard
The wizard kit (docs/design/admin-forms.md, section 5.3): a multi-step flow declared as data, each step a form built with the same groups and items as a section’s page, its values a draft handed to a command on finish.

Structs§

Action
A command and its argument template: a button or a link. The command’s declaration gives the title, icon, keys and when the action does not set, so an action and the palette entry are one.
Callout
A message with a tone and an optional action, at the top of a page or group.
Column
A column of a table, or a part of a list item: the record’s key it shows and its heading.
Confirmation
A question asked before an action’s command runs: a title, what happens, the verb of the button that goes on, and the danger style (the focus starts on Cancel).
Detail
A row’s detail sheet (Records::detail): a window-modal sheet listing the row’s declared keys as label and value lines, multi-line text kept, for a record holding more than its row shows.
DetailLine
One line of a detail sheet: the record’s key it shows and its label.
Empty
What an empty source shows: a message and an optional action.
Field
A value bound to the store or a draft.
FieldHooks
The hooks a field names.
FileInput
What a path field’s Browse chooses.
Finish
What finishing runs: a command, its arguments’ template (${key}; null: the draft itself, as an object), and the button’s verb.
Flow
A wizard being filled: the step shown, the draft, the steps passed.
Group
A heading and its rows in an inset box, collapsible.
IconCell
An icon cell’s value in a record (CellKind::Icon): a registry icon’s name (phosphor:cloud-slash, warning), its tone, and the reason the tooltip and the accessible name say. A bare string is the icon alone; a column’s text key then gives its tooltip.
Input
What a draft field declares of its value, in place of a setting’s descriptor: its default, its choices (value and label), its range, and whether it may be left empty. The checks it allows need no hook (Field::check).
Manifest
One owner’s contribution: scopes and sections, each section placed in its scope. Versioned (FORMAT).
Meta
What every node carries: a stable id (never translated, unique among its siblings), a title and description (translated through the strings catalogue), keywords for search, an icon, an order, and the when and enabled clauses (the when language).
Place
Where a deep link leads: scope/section/key (any tail may be left out), or a setting id alone, resolved to its first place.
Records
A record list or table: rows read from a source, each with its actions (${row.<key>} in their arguments).
RowChoice
A choice of a row field: the value written and its label.
RowField
An editable cell: a record’s value shown as a field (a toggle, a text, a choice) and written through a command whose arguments name the record (${row.<key>}) and the new value (${value}). In a table it takes the place of the column of its key, or adds one; in a list it shows under the record’s title. Its when and enabled read the record as row.<key>; its description is its tooltip.
Scope
A family of sections: a tab with an icon on the horizontal axis.
Section
An entry of the left panel and the page it shows, inside a scope.
SectionBuilder
A section being built (Manifest::section).
Status
A read-out: a label, a value, a tone. Read again after the events named, never per frame.
Step
A step: a form (groups of fields, statuses, callouts, records), its validate hook, whether it may be skipped.
Tree
The resolved tree: every manifest merged, scopes and sections in order.
Unknown
A brick a newer manifest declares and this version does not know: its node, the Meta read from it (for the diagnostic), and the node as it was read, written back unchanged.
ValueScope
A layer of values, by name: app and run are egui-pop’s, the others the host application’s (ValueScope::new).
Widget
A registered widget kind and its options: the declared exception.
Wizard
A wizard: its steps, its summary, what finishing runs, and what cancelling asks when something was entered.

Enums§

ActionStyle
How an action’s button looks.
Bind
Where a field’s value lives.
CellKind
How a cell shows its value.
CellText
A cell’s words a record gives: plain text, or a string key with its English and its { $name } arguments, translated where it is shown.
Check
What a field’s own checks found (Field::check); the shell words it in the interface’s language.
FieldKind
The eleven field kinds. The list is closed: a new one is a decision in the design note, not in a plugin. All but FieldKind::Note take input; a note is a read-only line (Field::note).
Item
A row of a group: every field, action, status and callout is one.
ManifestError
Why a manifest cannot be read.
RecordSource
Where a list’s or table’s records come from.
StatusSource
Where a status reads its value.
Tone
A tone: a callout’s, a status’s.

Constants§

FORMAT
The manifest format this framework reads. A newer one is refused.

Traits§

Clauses
The when and enabled clauses, for every node’s builder.

Functions§

cell_text
A record value as shown in a cell: text as it is, numbers and booleans written out, nothing for null.
form_context
The context a section’s clauses read: the application’s keys, and the section’s values as form.<field id> (booleans true or false, texts as they are, numbers written out).
holds
Whether a clause holds (none: it does). One that does not parse holds: Manifest::check reports it.
meter_share
A meter’s share: a number clamped to 0 to 1, none for anything else.
row_context
The context a row’s clauses read: the section’s, and the record’s values as row.<key> (booleans true or false, texts as they are).
tone_named
A tone from its name (a record’s tone key, a status’s answer).