HumanSignal / HumanSignal/label-studio
Support OR conditions in visibleWhen attribute
- Dominant language
- TypeScript
- Stars
- 28.3k
- Forks
- 3.7k
- Avg merge
- 14h
- Merged PRs (30d)
- 15
Description
**Is your feature request related to a problem? Please describe.**
The `visibleWhen` attribute doesn't support multiple conditions with `OR` logic. I need to show the same annotation control when either of two different choices are selected, but the syntax `visibleWhen="choice-selected:answer1,negative|choice-selected:answer2,negative"` doesn't work.
**To Reproduce**
```
```
**Expected behavior**
The Labels control should appear when either answer1 is "negative" OR answer2 is "negative". Currently, there's no way to express multiple conditions with OR logic in `visibleWhen`.
**Suggested solution**
Support OR conditions in `visibleWhen`, such as:
`visibleWhen="choice-selected:answer1,negative|choice-selected:answer2,negative"`
Or separate `visibleWhen` attributes that are OR'd together
**Environment:**
Label Studio Online
Version 1.19.0
**Workaround**
Currently requires creating duplicate annotation controls for each condition, which creates redundant UI elements and separate annotation results.
Contributor guide
Assessment
This issue has not been assessed yet.