phetsims / build-a-nucleus

"Build a Nucleus" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
0 stars 5 forks source link

Particles can stop being interactive #198

Closed Nancy-Salpepi closed 1 year ago

Nancy-Salpepi commented 1 year ago

With macOS 13.5.2 + safari:

On main, the particles in the collection area sometimes stop being interactive. This happens on both screens --sometimes with neutrons and sometimes with protons. I can still grab particles from the nucleus or from an energy level and add particles using the arrow. Nothing pops up in the console.

I haven't been able to come up with exact steps to reproduce, but here are a couple of videos. Maybe you can find the common thread.

https://github.com/phetsims/build-a-nucleus/assets/87318828/4fb3d5cb-d9ab-4d60-8f7c-be04e5df28c3

https://github.com/phetsims/build-a-nucleus/assets/87318828/c2091433-d840-4f09-9650-54abfc8e106f

zepumph commented 1 year ago

@Luisav1, this seems really bad. Let's investigate.

Luisav1 commented 1 year ago

Either of us @zepumph or I could take this on. Will first try to reproduce then look into maybe this was caused when the arrow buttons were refactored.

zepumph commented 1 year ago

Haven't reproduced yet. @Nancy-Salpepi let me know if you found a more reproducible case.

Nancy-Salpepi commented 1 year ago

hmmm. This happens to me on main within a few minutes of playing with the sim. With mac + safari/chrome.

It seems to eventually happen if I do these steps:

  1. Go to the Chart Intro screen and select the Zoomed In scene
  2. Press the Add protons + neutrons button 3-4 times
  3. Press the Remove protons + neutrons button 3-4 times
  4. Hover the mouse over the particles in the collection area to see if it is a hand or the normal mouse cursor
  5. Repeat steps 2-4 until one of the particles is no longer interactive.

https://github.com/phetsims/build-a-nucleus/assets/87318828/95131c75-defe-46c4-9b0e-24fde2d4f387

Luisav1 commented 1 year ago

Thanks @Nancy-Salpepi! We were able to reproduce it and test it with those steps. The animationEndedEmitter was not firing since in the Particle's step() function, there was no check for when the particle's destination is exactly at the position. @zepumph and I added a check for when the particle is at its destination to fire the animationEndedEmitter. @Nancy-Salpepi Could you check to make sure this isn't happening anymore? Thanks!

zepumph commented 1 year ago

Feel free to close.

Nancy-Salpepi commented 1 year ago

Working great now 🎉. Closing.