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

TimeControlNode PhET-iO API revision #890

Open
14 tasks
arouinfar opened this issue Dec 3, 2024 · 1 comment
Open
14 tasks

TimeControlNode PhET-iO API revision #890

arouinfar opened this issue Dec 3, 2024 · 1 comment

Comments

@arouinfar
Copy link

TimeControlNode contains a combination of these components, and the exact combination is variable sim-to-sim. Within a sim, there is sometimes variation between screens.

  • PlayPauseStepButtonGroup
    • PlayPauseButton
    • StepForwardButton
    • StepBackwardButton
  • SpeedRadioButtonGroup
    • FastRadioButton
    • NormalRadioButton
    • SlowRadioButton
  • FastForwardButton (e.g. Natural Selection)
  • RestartButton (e.g. Gravity and Orbits)

It’s unclear if FastForwardButton and RestartButton are actually part of TimeControlNode, or if they have been artificially inserted into the tree structure of TimeControlNode. I assumed the latter and therefore did not review these buttons in detail. If I am incorrect, please let me know and I will review.

The goals of the TimeControlNode are highly sim-dependent, so there needs to be flexibility to allow for developers to opt-out of subcomponent instrumentation, see #826. This issue also documents a variety of dynamic layout issues currently present.

In general:

  • Address TimeControlNode needs work for PhET-iO dynamic layout #826 (dynamic layout & opting-out of instrumentation)
  • Add warnings/documentation/whatever appropriate to the code to remind devs that regardless of what view elements may have been opted-out, isPlayingProperty and timeSpeedProperty should still always be instrumented.
  • If it’s not possible to handle LinkedProperties in common code as requested below, add documentation to remind devs that there should be a LinkedProperty to isPlayingProperty and timeSpeedProperty if the corresponding view elements are instrumented.
  • Review the listeners and emitters to determine if there are redundancies.
  • Determine what migration rules will be necessary.

PlayPauseStepButtonGroup

  • Verify that visibleProperty and enabledProperty are instrumented in common code and that they are phetioFeatured: true.

PlayPauseButton

  • Uninstrument ToggleNode.
    • Optional: There is no need to ever instrument a ToggleButton’s ToggleNode, so it might be worth searching through common code for other instances of this instrumentation and ripping it out.
  • Verify there is a LinkedProperty to isPlayingProperty, and if not, add it.
  • Verify that these are the only associated elements that are featured:
    • isPlayingProperty
    • visibleProperty
    • enabledProperty

Step Buttons

  • Uninstrument enabledProperty. It depends on isPlayingProperty and should never be client-controlled. (Nor should clients care to ask the sim if the button is enabled or not.)
  • The only featured element should be visibleProperty.

SpeedRadioButtonGroup

  • Verify there is a LinkedProperty to timeSpeedProperty, and if not, add it.
  • Verify that these are the only elements associated with the GROUP that are featured:
    • timeSpeedProperty
    • visibleProperty
    • enabledProperty
  • The individual radio buttons are a bit over-instrumented (no need for enabledProperty, for example), but RadioButtonGroup is on the docket for API cleanup and will be tracked in a separate issue.
@samreid
Copy link
Member

samreid commented Dec 13, 2024

On hold until #826 is complete.

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

3 participants