Skip to main content

Module wizard

Module wizard 

Source
Expand description

The wizard kit’s surface (docs/design/admin-forms.md, section 5.3): a wizard declared in a manifest (egui_pop_model::admin::wizard) fills the Settings app’s page while it runs: the stepper on the left, the step’s form, and a footer with Cancel, Back, Skip and Next (Finish on the summary).

  • Next is greyed while the step has a blocking problem, its reason in the tooltip and beside it; each problem shows under its field.
  • The stepper goes back to any step, and ahead to a step whose steps before it are valid; it says “Step 2 of 4, Destination” to assistive technology.
  • Cancel (and Escape) asks first when anything was entered.
  • Keys: Enter (when no widget takes it first: a text field, an open list, a focused control) and Alt+N go next or finish, Alt+B back, Escape cancels.
  • Every gesture is a command an agent runs too: admin.wizard.open ({"id", "step", "values", "focus"}), admin.wizard.set ({"key", "value"} or {"values"}), admin.wizard.next, admin.wizard.back, admin.wizard.skip, admin.wizard.go ({"step"}), admin.wizard.finish and admin.wizard.cancel ({"force"}); each answers the flow’s state, which the admin collector shows too.

Draft fields: a toggle, a number, a choice, a text, a path (with Browse when its input names a file to open or save: the files plugin’s chooser, its choice written into the draft), and a multi (a tick box per choice; its value the choices ticked, null for every choice).

A wizard opened as a focus screen (Admin::open_focus_wizard, "focus": true) is drawn over the main window’s whole page whatever the app’s window setting, the shell’s menus, status bar and centre hidden while it runs: a first-run setup, where nothing else is to be seen yet.

Finishing runs the wizard’s command with the draft as its arguments, then closes the wizard (and the Settings app, when the wizard opened it).

Constants§

CMD_WIZARD_BACK
Goes back a step.
CMD_WIZARD_CANCEL
Closes the wizard; asks first when anything was entered, unless {"force": true}.
CMD_WIZARD_FINISH
Runs the wizard’s command with the draft, and closes it.
CMD_WIZARD_GO
Goes to a step ({"step"}, summary for the summary).
CMD_WIZARD_NEXT
Goes to the next step, if the step shown is valid.
CMD_WIZARD_OPEN
Opens a wizard ({"id", "step", "values"}).
CMD_WIZARD_SET
Sets draft values ({"key", "value"} or {"values": {...}}).
CMD_WIZARD_SKIP
Skips an optional step.