Skip to content

feat(ui): show yes-or-no arguments as switches - #70

Merged
helightdev merged 5 commits into
mainfrom
boolean-arguments
Nov 15, 2026
Merged

helightdev merged 5 commits into
mainfrom
boolean-arguments

Conversation

@helightdev

@helightdev helightdev commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

An action's yes-or-no argument (destroy on Remove, hostname on Rename, force on Stop, restart on Grow root disk, create on Duplicate, the plugins' keep_volume and friends) was a text field holding `no` that you had to overwrite with `yes`. It is now a switch, drawn and toggled as on the set-up tabs.

  • An argument is a switch when it has `"kind": "boolean"`, or its `values` are exactly yes/no or true/false. berth's own flags and the yes-or-no arguments in the Docker and Incus manifests now declare the kind. The value sent is still the declared one (`yes`/`no`), so controllers and plugins see no change.
  • An action with a switch opens the full-screen form, on the host page as well as on provisioner and resource pages. Space, Enter or one click toggles a switch. Machine arguments on the set-up's Settings tab show switches too.
  • In the form, the action's `confirm` question comes when Run is chosen, as the usual y/n dialog, and names each switch that is on ("Remove studio? Destroy its machine is on."). Actions that keep the dialog still ask before their arguments.
  • The command line and the server take yes/no, true/false, on/off and 1/0 in any case and send the declared value. Anything else gets an error that lists what is accepted. A required yes-or-no is asked as a yes/no question, and an argument with a few values is asked as a choice.
  • Other fixed choices on the host page's one-at-a-time dialog (such as `source` of upgrade-server) are now offered as choices instead of free text.

The writing-plugins page documents the boolean kind.

The host page's form doesn't run `choices` commands, so an action that has one stays on the dialog. Its yes-or-no arguments are offered there as a choice of two.

An argument declared with kind boolean, or whose values are just yes and
no or true and false, is a switch in the action form, as on a set-up tab.
An action with a switch opens the form, on the host page too, and its
question is asked from Run with y or n, naming the switches that are on.
The command line and the server take yes/no, true/false, on/off and 1/0.
…wn question

An argument now carries fixed, why it keeps its default here, and a switch
can carry its own confirm, asked instead of the action's while it is on.
Remove uses both: destroy is fixed for a host no provisioner made, and on
it asks the destroy question. A dialog's keys are drawn inside its box,
and the form's footer shows them while its question is open.
@helightdev
helightdev merged commit 5496bff into main Nov 15, 2026
23 checks passed
@helightdev
helightdev deleted the boolean-arguments branch November 15, 2026 23:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant