From 909008bb613244f6dda1cb68401cff1ab4d2b919 Mon Sep 17 00:00:00 2001 From: nicomiguelino Date: Tue, 25 Aug 2026 03:07:21 -0700 Subject: [PATCH 1/2] docs: document depends_on conditional visibility for settings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The web console now supports a depends_on: { setting, values } key inside a setting's help_text schema so it only renders (and is submitted) while another setting's current value is one of the listed values. Purely a frontend-parsed convention, same as type/ options/advanced — no Rust changes needed since help_text stays an opaque string to the CLI. --- docs/EdgeApps.md | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/docs/EdgeApps.md b/docs/EdgeApps.md index 3b307240..a6b584a2 100644 --- a/docs/EdgeApps.md +++ b/docs/EdgeApps.md @@ -483,6 +483,7 @@ Edge App settings support additional input field types beyond plain text and pas - `properties.type`: One of `datetime`, `number`, `select`, `boolean`, `textarea`, `url`. - `properties.help_text`: Human-friendly description shown in the UI. - `properties.options` (only for `select`): Array of `{ label, value }` options. + - `properties.depends_on`: Optional `{ setting, values }` object that makes this field's visibility depend on another setting's current value. The field only renders (and is submitted) while `setting`'s current value is one of `values`, otherwise it's hidden and skipped. A malformed or stale reference (a typo in `setting`, or a setting later renamed or removed) fails open, so the field stays visible rather than disappearing. - **Storage**: Use `type: string` for all non-secret fields; use `type: secret` for password-like fields. The UI will coerce values appropriately (e.g., booleans) but values are stored as strings unless `type: secret`. - **Defaults**: Provide `default_value` at the setting level. For booleans, use `'true'` or `'false'` as strings. @@ -588,6 +589,43 @@ settings: type: url ``` +**Conditional visibility** + +```yaml +settings: + refresh_mode: + type: string + title: Refresh Mode + default_value: automatic + optional: true + help_text: + schema_version: 1 + properties: + type: select + help_text: Choose how often the content refreshes + options: + - label: Automatic + value: automatic + - label: Manual + value: manual + refresh_interval_seconds: + type: string + title: Refresh Interval (seconds) + default_value: '300' + optional: true + help_text: + schema_version: 1 + properties: + help_text: How often to refresh the content, in seconds + type: number + depends_on: + setting: refresh_mode + values: + - automatic +``` + +In this example, `refresh_interval_seconds` only appears in the install and edit UI while `refresh_mode` is set to `automatic`. Picking `manual` hides it, and its value isn't collected or written on save. + Notes: - These descriptors are backward-compatible; if no JSON is provided, the UI falls back to a plain text field for `string` and a password field for `secret`. From dd52956c880da5937591ed85f4b86066b22ed41b Mon Sep 17 00:00:00 2001 From: nicomiguelino Date: Tue, 25 Aug 2026 08:31:27 -0700 Subject: [PATCH 2/2] docs: clarify depends_on with optional false --- docs/EdgeApps.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/EdgeApps.md b/docs/EdgeApps.md index a6b584a2..a765b803 100644 --- a/docs/EdgeApps.md +++ b/docs/EdgeApps.md @@ -483,7 +483,7 @@ Edge App settings support additional input field types beyond plain text and pas - `properties.type`: One of `datetime`, `number`, `select`, `boolean`, `textarea`, `url`. - `properties.help_text`: Human-friendly description shown in the UI. - `properties.options` (only for `select`): Array of `{ label, value }` options. - - `properties.depends_on`: Optional `{ setting, values }` object that makes this field's visibility depend on another setting's current value. The field only renders (and is submitted) while `setting`'s current value is one of `values`, otherwise it's hidden and skipped. A malformed or stale reference (a typo in `setting`, or a setting later renamed or removed) fails open, so the field stays visible rather than disappearing. + - `properties.depends_on`: Optional `{ setting, values }` object that makes this field's visibility depend on another setting's current value. The field only renders (and is submitted) while `setting`'s current value is one of `values`, otherwise it's hidden and skipped. A malformed or stale reference (a typo in `setting`, or a setting later renamed or removed) fails open, so the field stays visible rather than disappearing. A field with `depends_on` can still be marked `optional: false`; its required-ness is only enforced while the field is visible, and is skipped along with the rest of validation while it's hidden. - **Storage**: Use `type: string` for all non-secret fields; use `type: secret` for password-like fields. The UI will coerce values appropriately (e.g., booleans) but values are stored as strings unless `type: secret`. - **Defaults**: Provide `default_value` at the setting level. For booleans, use `'true'` or `'false'` as strings.