Skip to content

Enhance test input documentation with conditional visibility feature.#101

Open
projkov wants to merge 2 commits into
inferno-framework:mainfrom
projkov:enable-when-docs
Open

Enhance test input documentation with conditional visibility feature.#101
projkov wants to merge 2 commits into
inferno-framework:mainfrom
projkov:enable-when-docs

Conversation

@projkov
Copy link
Copy Markdown
Contributor

@projkov projkov commented Feb 6, 2026

Updates the docs site for the enable-when-docs work: documents the enable_when input option and conditional visibility, adds the missing select input type, and fixes a few doc typos/formatting issues.

Changes

Inputs and outputs (docs/writing-tests/test-inputs-outputs.md)

  • Conditional visibility: New section "Conditional visibility for inputs" describing enable_when and when to use it (e.g. with Radio or Select inputs), with a full example (radio + enable_when for bundle source).
  • Input options: Document enable_when in the input options list as (optional) with input_name and value.
  • Input types: Add the 'select' type to the list and update the count to "6 possible values."
  • Typos / formatting: Fix 'checkbox'checkbox', double space in title: description, trailing spaces in AuthInfo code blocks, and list continuation indentation under "Behind the Scenes."

Other

  • docs/concepts.md: Fix unclosed quote in figure alt ("Diagram of Inferno Deployment"Diagram of Inferno Deployment").
  • .tool-versions: Ensure newline at end of file.
  • Gemfile.lock: Add arm64-darwin-25 platform (from local bundle install).

- `description:` - a description which is displayed in the UI.
- `type:` - controls the type of HTML input element used in the UI. Currently
there are 5 possible values:
there are 6 possible values:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the count was off before

Suggested change
there are 6 possible values:
there are 7 possible values:

end
```

### Conditional visibility for inputs
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### Conditional visibility for inputs
### Conditional UI visibility for inputs

Locking an input can force it to use a value from a previous test's output, or
the default value.
- `hidden:` - (**default: false**) hide the input from the UI. Must be used with either `optional: true` or `locked: true`.
- `enable_when` - (**optional**) adds conditional visibility for inputs. It's a hash with `input_name` and `value`.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- `enable_when` - (**optional**) adds conditional visibility for inputs. It's a hash with `input_name` and `value`.
- `enable_when` - (**optional**) adds conditional UI visibility for the input, causing it to be displayed only when the indicated input has the specified value. The value is a hash with keys `input_name` and `value`.

Comment thread docs/writing-tests/test-inputs-outputs.md Outdated
@projkov projkov requested a review from karlnaden May 21, 2026 10:11
Copy link
Copy Markdown
Contributor

@karlnaden karlnaden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great - 3 small tweaks requested.

Comment on lines +277 to +278
5. All dependent inputs are `optional: true` so hidden fields do not block submitting the modal.
6. The group is `optional` so the entire demo can be skipped, matching the inferno-core demonstration pattern.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove list entry 6 - not relevant


A **select** input works the same way as radio for the controlling field.

The following example is adapted from the inferno-core demo suite. It models supplying a FHIR Bundle in one of three mutually exclusive ways: paste JSON, provide a URL, or run a `$summary` operation (FHIR server URL and patient ID).
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update to:

The following example models supplying a FHIR Bundle in one of three mutually exclusive ways: paste JSON, provide a URL, or run a $summary operation (FHIR server URL and patient ID).


When a test needs related inputs but only some apply at a time, `enable_when` controls **conditional visibility in the inputs modal only**. It does not change how inputs are defined in the DSL or how values are read in `run` blocks. Use it when several inputs represent **alternative paths** for the same data—showing every field at once would clutter the modal or confuse users. A typical pattern is a single radio or select choice that reveals only the fields relevant to the selected method.

**Semantics:**
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change to Usage:

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.

2 participants