phetsims / molecule-shapes

"Molecule Shapes" is an educational simulation in HTML5, by PhET Interactive Simulations.
http://phet.colorado.edu/en/simulation/molecule-shapes
GNU General Public License v3.0
5 stars 6 forks source link

Assertion errors appear when attempting to add checkbox to empty options panel #235

Closed Nancy-Salpepi closed 1 year ago

Nancy-Salpepi commented 2 years ago

Test device MacBook Air (m1 chip)

Operating System macOS 13.0

Browser safari/chrome

Problem description For https://github.com/phetsims/qa/issues/845 and https://github.com/phetsims/qa/issues/844 In Studio: After setting checkbox visibleProperty to false for all checkboxes in the Options panel, attempting to change the visibleProperty back to true, results in assertion errors.

Steps to reproduce In Basics:

  1. In studio, select "all" under PhET-iO elements
  2. Set moleculeShapesBasics.modelScreen.view.optionsPanel.showBondAnglesCheckbox.visibleProperty to false --The title 'Options' is still present on the screen
  3. Try to set moleculeShapesBasics.modelScreen.view.optionsPanel.showBondAnglesCheckbox.visibleProperty to true --assertion errors appear

This also happens on the Real Molecules screen.

In full version of the sim: Set both 'moleculeShapes.modelScreen.view.optionsPanel.showBondAnglesCheckbox.visibleProperty' and `moleculeShapes.modelScreen.view.optionsPanel.showLonePairsCheckbox.visibleProperty' to false. Then try and set one to true.

Visuals

Screenshot 2022-10-27 at 9 13 17 AM
Nancy-Salpepi commented 2 years ago

This error doesn't occur when I do something similar in the Name Panel, but does happen with the Bonding Panel and Lone Pair Panel.

samreid commented 1 year ago

I was able to easily reproduce this problem. Looks like it is trying to set a negative preferred width for some reason. I could likely come up with a working workaround, but may be better to get help from @jonathanolson or @marlitas about how to deal with that in the layout engine.

jonathanolson commented 1 year ago

Commit should handle this above, closing. Thanks!