phetsims / acid-base-solutions

"Acid-Base Solutions" is an educational simulation in HTML5, by PhET Interactive Simulations.
http://phet.colorado.edu/sims/html/acid-base-solutions/latest/acid-base-solutions_en.html
GNU General Public License v3.0
4 stars 7 forks source link

PhET-iO review for `strengthControl` #185

Closed pixelzoom closed 1 year ago

pixelzoom commented 1 year ago

The My Solutions screen has this control panel:

screenshot_2089

When the switch is set to "strong", we want to hide the slider, but keep the empty space for it in the control panel:

screenshot_2090

But we also want to allow the PhET-iO client to permanently hide the slider. And when they do so, the space in the control panel should disappear:

screenshot_2091

Accomplishing this was tricky. It needs to be reviewed, and probably described in the Client Guide.

Here's the relevant part of acidBaseSolutions.mySolutionScreen.view.solutionPanel.strengthControl in the tree:

screenshot_2093

strengthControl.sliderWrapper.slider.visibleProperty is phetioReadOnly: true. It's controlled by the sim, and is a DerivedProperty.

If the client wants to hide the slider, they need to use strengthControl.sliderWrapper.visibleProperty.

arouinfar commented 1 year ago

@Nancy-Salpepi and I reviewed this, and it looks good. I added a note in #191 to document how to hide the slider. Thanks @pixelzoom!