phetsims / ratio-and-proportion

"Ratio and Proportion" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
1 stars 4 forks source link

Standard PhET-iO wrapper isn't always in correct state with Ratio Lock on #507

Closed Nancy-Salpepi closed 2 years ago

Nancy-Salpepi commented 2 years ago

Test device MacBook Air m1 chip

Operating System macOS 12.5.1

Browser Safari 15.6.1

Problem description For https://github.com/phetsims/qa/issues/831, in the Studio wrapper on the Create Screen: Creating my own challenge and then locking the ratio will result in an incorrect state in the standard PhEt-iO wrapper. The hands will be in different positions and the checkbox will not be checked.

Steps to reproduce

  1. In studio, go to the create screen
  2. Make your own challenge--ex. 2:1
  3. Move one of the hands until the challenge is met
  4. Check the Ratio Lock checkbox
  5. Press Test button

**If you don't change the challenge ratio in the combo box (skip step 2) and just check the Ratio Lock checkbox--the sim launches in the correct state.

Visuals

https://user-images.githubusercontent.com/87318828/188722680-b64607a4-e854-47b8-a517-8ecbbf08bcb0.mp4

Troubleshooting information: !!!!! DO NOT EDIT !!!!! Name: ‪Ratio and Proportion‬ URL: https://phet-dev.colorado.edu/html/ratio-and-proportion/1.2.0-dev.31/phet/ratio-and-proportion_all_phet.html Version: 1.2.0-dev.31 2022-08-24 16:50:40 UTC Features missing: touch Flags: pixelRatioScaling User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.6.1 Safari/605.1.15 Language: en-US Window: 1322x704 Pixel Ratio: 2/1 WebGL: WebGL 1.0 GLSL: WebGL GLSL ES 1.0 (1.0) Vendor: WebKit (WebKit WebGL) Vertex: attribs: 16 varying: 30 uniform: 1024 Texture: size: 16384 imageUnits: 16 (vertex: 16, combined: 32) Max viewport: 16384x16384 OES_texture_float: true Dependencies JSON: {}
zepumph commented 2 years ago

I can't reproduce this on master. I believe this is a great example of how https://github.com/phetsims/axon/issues/409 is saving us time in state setting. Tagging @samreid here (yay!). The lockedProperty for the ratio can change the enabledRangeProperty in a listener, and the value of it is checked on in the tupleProperty listener.

@Nancy-Salpepi can you please confirm fixed on master and feel free to close.

Nancy-Salpepi commented 2 years ago

Yes! Looks good @zepumph! Closing.

Nancy-Salpepi commented 2 years ago

Sorry @zepumph. I need to reopen this. I just tried it in the State wrapper on master and I get an "assertion failed" error when setting the state a second time with Ratio Lock on.

Steps:

  1. In the State wrapper, go to the create screen
  2. Set state rate = 0
  3. Change my challenge (2:1) and move hands to reach challenge
  4. Check Ratio Lock
  5. Press Set State Now button
  6. Go back to the upstream sim and change the challenge ratio (3:1) and move hands to reach challenge
  7. Repeat steps 4 and 5 > error message Screen Shot 2022-09-08 at 8 42 10 PM
Screen Shot 2022-09-08 at 8 41 33 PM
zepumph commented 2 years ago

Thanks! This is caused by an assertion that is helpful during normal sim usage, but will trigger incorrectly during state set. Can you please confirm things are fixed now and feel free to close.

Nancy-Salpepi commented 2 years ago

Looks good is studio and state. Closing.