phetsims / geometric-optics

Geometric Optics is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
6 stars 5 forks source link

Should there be a range or error message when changing positionProperty values? #464

Closed Nancy-Salpepi closed 1 year ago

Nancy-Salpepi commented 1 year ago

Test device MacBook Air M1 chip

Operating System 13.3.1

Browser Safari

Problem description For https://github.com/phetsims/qa/issues/938, I am noticing 2 odd things in studio when using the 'get value' 'set value' buttons for positionProperty:

  1. For lensScreen.model.scenes.arrowScene.arrowObject1.positionProperty, I am able to enter a positive x value which moves the arrow to the right side of the lens. Once I either try to move the arrow, or launch the sim, the x value changes to -40.

  2. For lensScreen.model.scenes.framedScene.framedObject.positionProperty, if I enter a value larger than -40, the object is placed at x= -40. The same is true for the lightScene. I was wondering if an error message should pop up or if a range should be given here?

Steps to reproduce

  1. In studio, go to lensScreen.model.scenes.arrowScene.arrowObject1.positionProperty and press 'get value'
  2. Change the value of x to a positive number. Press 'set value'
  3. Try to move the arrow
  4. Repeat steps with lensScreen.model.scenes.framedScene.framedObject.positionProperty

Visuals

Screenshot 2023-05-10 at 1 52 56 PM
arouinfar commented 1 year ago

Thanks @Nancy-Salpepi. This came up in https://github.com/phetsims/geometric-optics/issues/454 (and other sims linked in that issue too) and we decided to do nothing. Validating positionProperty is far more complicated than validating a simple number like diameterProperty. In examples.md, we recommend that clients set the desired position by interacting with the simulation and using "Get Command".