-
Notifications
You must be signed in to change notification settings - Fork 6
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
Inconsistent availability of buttons #459
Comments
Typically the Restart Button restores one of two possible states
With PhET-iO this becomes a bit more complicated. When the Standard PhET-iO Wrapper is created, the current state becomes the state restored by the ResetAllButton, the scene reset button, and the Restart Button (at least until the user creates a new custom configuration). I think there's a problem with how the Restart Button restores the saved configuration. It seems to always reset the time to zero, regardless of the time displayed when the saved configuration was created (this is true even in the 1.5 version). This seems like a bug to me.
The Clear button should be enabled if the displayed time is non-zero. In the video, pressing the scene reset button should have re-enabled the Clear button because it restores the state to 20 Earth Minutes. If the sim is launched while paused, the Restart button should definitely be disabled, since the initial state should be identical to the what is restored by the Restart button. If this sim is playing, I would expect the button to only be disabled during the first frame, but once the objects start moving, the button would be enabled. |
@marlitas and I reviewed the issue and summarized the recommendations:
|
@marlitas and I made good progress, and this issue is ready for cherry-picking. |
Things look good in master and 1.6.0-rc.3.
If I launch the sim after a certain amount of time has passed (or open saved version), press the clear button so time = 0, press Play and then press Restart, the time returns to 0 and not the time of the original. @samreid based on your #455 (comment) that sounds correct so I'm going to close this issue. If I'm wrong....I'm sorry and please reopen! |
Yes, Restart is supposed to go to the beginning of the experiment, and not the stored PhET-iO initial state, so that sounds reasonable. Thanks! |
There is one more TODO for this issue, see gravity-and-orbits/js/common/model/Body.ts Line 232 in 4072918
|
Fixed as @zepumph prescribed, it seemed straightforward. Closing. |
Test device
Operating System
MacBook Air (m1 chip)
Browser
safari 16
Problem description
For phetsims/qa#838, in both Studio and State wrappers:
In the launched sim, both the Restart button and Clear button are enabled. Pressing the Reset button next to the scene disables them.
Steps to reproduce
Should both the Clear button and Restart buttons be disabled when the sim is launched? This would prevent issues like the one reported by @KatieWoe in #457
@arouinfar @samreid thoughts?
Visuals
state.of.buttons.mp4
The text was updated successfully, but these errors were encountered: