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

Undo button disappears on one screen when pressing buttons on the other #206

Closed Nancy-Salpepi closed 11 months ago

Nancy-Salpepi commented 11 months ago

Test device iPad and Mac

Operating System iOS17 and OS14

Browser safari/chrome

Problem description For https://github.com/phetsims/qa/issues/988, I noticed that if I press a button, such as the decay button, on one screen the Undo button on the other screen will disappear. Was that the intended behavior?

Steps to reproduce

  1. On the Decay Screen, create any radioactive isotope
  2. Press the corresponding decay type button
  3. Switch to the Intro chart Screen and press any button-- add proton, add neutron, add proton + neutron
  4. Switch back to the Decay Screen -- the undo button will be gone

The same thing happens if I start on the second screen and then press a button on the first.

Visuals

https://github.com/phetsims/build-a-nucleus/assets/87318828/e7030634-a17d-436c-a946-9e61a10c9454

Troubleshooting information: !!!!! DO NOT EDIT !!!!! Name: ‪Build a Nucleus‬ URL: https://phet-dev.colorado.edu/html/build-a-nucleus/1.1.0-rc.1/phet/build-a-nucleus_all_phet.html Version: 1.1.0-rc.1 2023-09-26 23:04:02 UTC Features missing: applicationcache, applicationcache, touch Flags: pixelRatioScaling User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36 Language: en-US Window: 1430x724 Pixel Ratio: 2/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: 30 uniform: 1024 Texture: size: 16384 imageUnits: 16 (vertex: 16, combined: 32) Max viewport: 16384x16384 OES_texture_float: true Dependencies JSON: {}
Luisav1 commented 11 months ago

This is not the intended behaviour as these are two separate undo buttons. I believe this behaviour may be happening since the visibility of the undo button is controlled by the undoButtonEmitter which is fired in the common BANScreenView. I will look more into this. https://github.com/phetsims/build-a-nucleus/blob/e15b04d26ef16b510eb94f44300d5a33c86f963e/js/common/view/BANScreenView.ts#L167-L172

zepumph commented 11 months ago

Excellent. Let me know if you want assistance.

Luisav1 commented 11 months ago

Meeting with @zepumph, realized that the hideUndoButtonEmitter should not be static in BANScreenView. Made it non-static in the commit above. This seems fixed now on my end after only testing it a bit. @Nancy-Salpepi feel free to close if it's all good!

Nancy-Salpepi commented 11 months ago

This looks fixed on main. Should we keep this open for verification in the next rc?

zepumph commented 11 months ago

Cherry picked onto 1.1 branch above. Ready for QA verification in RC spot check. Please feel free to close.

Nancy-Salpepi commented 11 months ago

This looks good in rc.2