Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

fix: HumanSignal/label-studio#4386: Added tag-selected mode for visibleWhen #1614

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ftesser
Copy link

@ftesser ftesser commented Nov 8, 2023

PR fulfills these requirements

  • Commit message(s) and PR title follows the format [fix|feat|ci|chore|doc]: TICKET-ID: Short description of change made ex. fix: DEV-XXXX: Removed inconsistent code usage causing intermittent errors
  • Tests for the changes have been added/updated (for bug fixes/features)
  • [x ] Docs have been added/updated (for bug fixes/features)
  • Best efforts were made to ensure docs/code are concise and coherent (checked for spelling/grammatical errors, commented out code, debug logs etc.)
  • Self-reviewed and ran all changes on a local instance (for bug fixes/features)

Change has impacts in these area(s)

(check all that apply)

  • Product design
  • Frontend

Describe the reason for change

As described in HumanSignal/label-studio#4386 in label studio version 1.7.3 visibleWhen="choice-selected" whenTagName="name" worked clicking on the label.

With label studio version > 1.7.3 that does not work any-more.

I realized that the difference was caused by commit 791b713.

I suppose that it was probably an unintended effect in label studio version <= 1.7.3
So I propose to add a new variant for visibleWhen: visibleWhen="tag-selected" whenTagName="name" to have the same behaviour: shows panes clicking on the label.

What does this fix?

Fix: HumanSignal/label-studio#4386

Now using visibleWhen="tag-selected" the following labeling interface as follows:

<View>
<View>
<Text name="text" value="$text" granularity="word"/>
</View>
<View>
<Labels name="name" toName="text">
<Label value="text_selection" background="red" alias="alias" granularity="word"/>
</Labels>
<View style="display: flex; flex-wrap: wrap;">
<View className="alias" style="margin: 2px;" visibleWhen="tag-selected"  whenTagName="name">
<Choices name="choices" toName="text" choice="multiple" showInLine="true" required="true">
<Choice alias="yes" value="yes" selected="true" />
<Choice alias="no" value="no" />
</Choices>
</View>
</View>
</View>
</View>

What is the new behavior?

Shows additional panels clicking on the label.

No click:
image

Click:
image

What is the current behavior?

choice-selected doesn't work like label studio version <= 1.7.3

What libraries were added/updated?

None.

Does this change affect performance?

No.

Does this change affect security?

No.

What alternative approaches were there?

(briefly list any if applicable)

What feature flags were used to cover this change?

(briefly list any if applicable)

Does this PR introduce a breaking change?

(check only one)

  • Yes, and covered entirely by feature flag(s)
  • Yes, and covered partially by feature flag(s)
  • No
  • Not sure (briefly explain the situation below)

What level of testing was included in the change?

(check all that apply)

  • e2e
  • integration
  • unit

Which logical domain(s) does this change affect?

(for bug fixes/features, be as precise as possible. ex. Authentication, Annotation History, Review Stream etc.)

@ftesser ftesser changed the title Fix: HumanSignal/label-studio#4386: Added tag-selected mode for visibleWhen fix: HumanSignal/label-studio#4386: Added tag-selected mode for visibleWhen Nov 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

VisibleWhen unexpected behavior in label studio version 1.8.0
2 participants