phetsims / masses-and-springs

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

Spring no longer behaves like published when putting on or taking off a mass. #373

Closed KatieWoe closed 1 year ago

KatieWoe commented 1 year ago

Test device Samsung Operating System Win 11 Browser Chrome Problem description For https://github.com/phetsims/qa/issues/936. The behavior of the hanging spring when putting on a mass or removing it is different from published. When removing the mass from the spring the spring stays in its last position, whether extended or contracted, until the mass is dropped. In published it would return to default rest as soon as it was removed. Much more buggy and problematic though is the behavior when putting the mass on the spring. The spring stays at rest until the mass is added. In published the mass and spring would connect when in line and you could start the mass at any level of extension or compression. You can no longer do this.

Visuals

https://user-images.githubusercontent.com/41024075/236538350-6aa01290-aae3-4b07-a37d-7917fac2f044.mp4

https://user-images.githubusercontent.com/41024075/236538439-6d96d497-21f9-47eb-a64d-5a95cc734634.mp4

Troubleshooting information:

!!!!! DO NOT EDIT !!!!! Name: ‪Masses and Springs‬ URL: https://phet-dev.colorado.edu/html/masses-and-springs/1.1.0-dev.2/phet/masses-and-springs_all_phet.html Version: 1.1.0-dev.2 2023-05-02 23:06:13 UTC Features missing: applicationcache, applicationcache, touch Flags: pixelRatioScaling User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36 Language: en-US Window: 1536x714 Pixel Ratio: 1.25/1 WebGL: WebGL 1.0 (OpenGL ES 2.0 Chromium) GLSL: WebGL GLSL ES 1.0 (OpenGL ES GLSL ES 1.0 Chromium) Vendor: WebKit (WebKit WebGL) Vertex: attribs: 16 varying: 31 uniform: 4096 Texture: size: 8192 imageUnits: 32 (vertex: 32, combined: 64) Max viewport: 8192x8192 OES_texture_float: true Dependencies JSON: {}
arouinfar commented 1 year ago

Good find @KatieWoe. This behavior is really buggy, and we should definitely fix it for this release.

jbphet commented 1 year ago

@KatieWoe - I've made a change, please check the behavior on master and see if it is back to how it used to behave.

@marlitas - I think this problem was introduced in d13cce753fc6b674751ebcf28d8ca8b3087d046d. I want to run the change I just made by you because I'm not quite clear on what you were going for in that commit. Can you please look at the two commits and verify that what I've done makes sense and I'm not missing something? Thanks.

When these two things have been checked, please assign the issue back to me.

KatieWoe commented 1 year ago

Master is much better. Seems to work like published for the most part. The bounds where the mass was considered on/off seemed a bit different on the left and right sides of the spring. But I could be wrong there.

marlitas commented 1 year ago

@jbphet I honestly don't really remember why I had onDrag being called in both the start and end options... Your change makes sense, and if the sim is now working as expected, that's good enough for me!

Thanks for checking in.

jbphet commented 1 year ago

Closing based on @KatieWoe and @marlitas comments above and my own testing.