Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Issue-4386: Added tag-selected mode for View visibleWhen #6443

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

ftesser
Copy link

@ftesser ftesser commented Sep 26, 2024

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)
  • 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
  • Backend (Database)
  • Backend (API)
  • Frontend

Describe the reason for change

As described in #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 HumanSignal/label-studio-frontend@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: #4386

Now using visibleWhen="tag-selected" the following labelling 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.

Without clicking on label:

immagine

Clicking on label:

immagine

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.)

Copy link

netlify bot commented Sep 26, 2024

👷 Deploy request for label-studio-docs-new-theme pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 1dad704

Copy link

netlify bot commented Sep 26, 2024

👷 Deploy request for heartex-docs pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 1dad704

@ftesser ftesser changed the title Added tag-selected mode for View visibleWhen [feat] Added tag-selected mode for View visibleWhen Sep 26, 2024
@ftesser ftesser changed the title [feat] Added tag-selected mode for View visibleWhen feat: Added tag-selected mode for View visibleWhen Sep 26, 2024
@ftesser ftesser changed the title feat: Added tag-selected mode for View visibleWhen feat: None: Added tag-selected mode for View visibleWhen Sep 26, 2024
@ftesser ftesser changed the title feat: None: Added tag-selected mode for View visibleWhen feat: Issue-4386: Added tag-selected mode for View visibleWhen Sep 26, 2024
@ftesser ftesser changed the title feat: Issue-4386: Added tag-selected mode for View visibleWhen feat: Added tag-selected mode for View visibleWhen Sep 27, 2024
@ftesser ftesser changed the title feat: Added tag-selected mode for View visibleWhen feat: Issue-4386: Added tag-selected mode for View visibleWhen Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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