Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restart button not working correctly in launched sim #327

Closed
Tracked by #1029
Nancy-Salpepi opened this issue Jan 4, 2024 · 7 comments
Closed
Tracked by #1029

Restart button not working correctly in launched sim #327

Nancy-Salpepi opened this issue Jan 4, 2024 · 7 comments
Assignees

Comments

@Nancy-Salpepi
Copy link

Test device
MacBook Air M1 chip

Operating System
14.1.2

Browser
Chrome

Problem description
For phetsims/qa#1015, in Studio and State Wrappers, pressing the Restart button in the launched sim doesn't return the sim to its launched state.

From Amy on Slack:
Amy Rouinfar
1:51 PM

This is a bug. When setting state, it should also override the restart button state, just like the ResetAllButton. For example, in Studio, press play and let the planet move a bit and then create a standard wrapper. The initial state of the standard wrapper should match up with the moment you pressed ‘Test’ to create it. The ResetAllButton should restore this same state, as should the Restart button (assuming you don’t interact with the sim in a way that creates a new restart state). Currently, the ResetAllButton is behaving correctly, but the Restart button is not.

Steps to reproduce

  1. In Studio, on either screen press the Play button
  2. Once the planet has moved a bit, press Pause
  3. Press Test --the restart button is enabled in the standard wrapper (should it be?)
  4. Press Play
  5. Press Restart

Visuals
Video starts after pressing Test in Studio (It takes too long for the standard wrapper to open)

RestartButton.mp4
@AgustinVallejo
Copy link
Contributor

Pushed a possible fix using a workaround of isSettingPhetioState. @pixelzoom could you please review the above commit? I feel like there might be a more elegant and phet-io-y way to achieve the same effect. If it looks good, could you assign to @Nancy-Salpepi for QA review and then cherry picking?

@AgustinVallejo
Copy link
Contributor

Nevermind, this breaks the restart button in the state wrapper (upsteam restarts to the default position whereas downstream goes to the current one). Will keep looking.

@KatieWoe
Copy link

KatieWoe commented Jan 5, 2024

I believe one reason this may happen is that, in the sim in studio before it is launched the restart button goes back to that starting position which is correct in that version of the sim. When launched the restart button still points to that position.

@AgustinVallejo
Copy link
Contributor

After talking with @arouinfar and @pixelzoom it seems the fix was indeed working for state wrapper. I pushed a little improvement and it's now ready for review and then cherry pick!

@Nancy-Salpepi
Copy link
Author

This looks good now in State/Studio wrappers.
I just wanted to confirm that it is correct that the Restart button is enabled when I launch the standard wrapper following the original steps above?
If that is correct, then this is ready for cherry-picking.

@AgustinVallejo
Copy link
Contributor

I'd say it's okay to have it enabled since there is a "history" of the sim when you launch it (the paths). With the restart button they disappear and T goes back to 0.

@Nancy-Salpepi
Copy link
Author

This looks good in rc.4
Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants