phetsims / sun

User-interface components for PhET simulations, built on top of Scenery.
MIT License
4 stars 12 forks source link

How to set `phetioIsVisiblePropertyInstrumented: false` for the content of Checkbox and AquaRadioButton #784

Closed pixelzoom closed 2 years ago

pixelzoom commented 2 years ago

How do we want to generally prevent PhET-iO clients from making the content of a Checkbox or AquaRadioButton invisible? We don't want to end up with just the box of a Checkbox, or just the circular button of an AquaRadioButton.

Currently, we have to add phetioIsVisiblePropertyInstrumented: false. And I find myself having to do this for every Checkbox and AquaRadioButton.

How do we make this more foolproof, or (even better) something developers don't have to deal with.

This also applies to VerticalCheckboxGroup and AquaRadioButtonGroup. Another option would be not to worry about this. Let clients hide these things, and come to their own conclusion that it doesn't make sense. That's a question for designers.

pixelzoom commented 2 years ago

@samreid also wondered if we should set phetioReadOnly: true instead of phetioIsVisiblePropertyInstrumented: false. Again, a question for designers.

zepumph commented 2 years ago

We discussed this in PhET-iO meeting, looking at NATURAL_SELECTION/WolvesCheckbox, and we feel like there is a good chance that most of this will be solved in https://github.com/phetsims/scenery/issues/1447, where text Nodes won't get a visibleProperty by default.

The content for a checkbox/radioButtonGroup most often doesn't get instrumented unless it was a text (for string editability), so we will close this issue, and reopen if https://github.com/phetsims/scenery/issues/1447 doesn't solve things.