-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
Is your feature request related to a problem? Please describe.
In the current system, all outputs defined in a block are always visible in UI components such as output-select and tag-dropdown, regardless of whether they are relevant based on the block’s internal state or user-selected options. This leads to a cluttered and sometimes confusing interface where users see outputs that may not apply to their current configuration. For example, if a block supports multiple operations, users may see outputs related to all operations instead of just the one currently selected.
Describe the solution you'd like
Introduce a condition field in the OutputFieldDefinition type to enable conditional display of outputs. This field would allow developers to define criteria under which specific outputs are shown in the UI. For example:
outputs: {
papers: {
type: 'json',
description: 'Found papers data',
condition: { field: 'operation', value: 'arxiv_search' }
},
totalResults: {
type: 'number',
description: 'Total results count',
condition: { field: 'operation', value: 'arxiv_search' }
}
}
In this case, papers and totalResults would only be shown when the operation field has the value 'arxiv_search'.
Support for more advanced conditions such as not, array values, and logical AND should also be included.
Describe alternatives you've considered
Manually hiding outputs in the UI layer based on hardcoded logic (not scalable or maintainable).
Overloading the input condition system to apply to outputs, which could be unintuitive and confusing in terms of architecture.
Avoiding conditional output display entirely, which negatively impacts UX by exposing users to irrelevant options.
Additional context
This behavior mirrors existing conditional logic already available for inputs, making the system more consistent. The feature has already been implemented in PR #904, which includes updates to relevant UI components (tag-dropdown.tsx, output-select.tsx) and adds support for conditional logic evaluation during output rendering.