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

Consistent PhET-iO API/assertions for UI component LinkedElements #921

Open
Tracked by #922
zepumph opened this issue Dec 16, 2024 · 1 comment
Open
Tracked by #922

Consistent PhET-iO API/assertions for UI component LinkedElements #921

zepumph opened this issue Dec 16, 2024 · 1 comment
Assignees

Comments

@zepumph
Copy link
Member

zepumph commented Dec 16, 2024

#920
#914

  • In checkbox we added this code, and think we can factor it out for reuse in radio buttons, slider, combo box, etc:

        // must be after the Checkbox is instrumented
        this.addLinkedElement( property, {
          tandemName: 'property'
        } );
    
        if ( assert && Tandem.VALIDATION && this.isPhetioInstrumented() ) {
          assert && assert( property.isPhetioInstrumented(), 'Property should be instrumented if Checkbox is instrumented' );
    
          if ( this.phetioFeatured ) {
            assert && assert( property.phetioFeatured, `Property should be featured if the controlling Checkbox is featured: ${property.phetioID}` );
          }
        }
  • Handle situations like MysteryOrCustomLauncherSection where the UI is fed by an uninstrumented DynamicProperty purposefully.

  • Apply the phetioLinkedProperty slider pattern to support things.

@zepumph
Copy link
Member Author

zepumph commented Dec 20, 2024

I now see that this issue is most likely a duplicate of #782, but I will work in this issue to make things more clear how we got to this work.

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

No branches or pull requests

1 participant