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

Uninstrument Node.pickableProperty in exchange for Node.inputEnabledProperty #1158

Closed
zepumph opened this issue Feb 18, 2021 · 14 comments
Closed

Comments

@zepumph
Copy link
Member

zepumph commented Feb 18, 2021

This is a sub/side issue from #1116.

@arouinfar noted the need to change client guides and overrides as part of this process. What fun!

On hold until #1116 is read to work for PhET-iO.

@zepumph
Copy link
Member Author

zepumph commented Feb 26, 2021

Node.inputEnabledProperty is not optionally instrumentable. So this issue is no longer on hold for #1116, but I ran into #1164, and I don't want to continue on this until that is solved.

@zepumph
Copy link
Member Author

zepumph commented Feb 26, 2021

Some points for this issue as a list:

  • Uninstrument pickableProperty from Node
  • Convert all usages of pickablePropertyPhetioInstrumented to -> inputEnabledPropertyPhetioInstrumented
  • Part of this work should be to look through instrumented usages of pickableProperty and make sure that we are now setting inputEnabled instead. This is from Add PhET-iO support for Node.inputEnabledProperty #1116 (comment)
  • Update all the Client guides that contain pickableProperty stuff
  • Update all the overrides files that contain pickableProperty stuff
  • Confirm in some studio instances that there are no more pickableProperties

@zepumph
Copy link
Member Author

zepumph commented Feb 26, 2021

We decided we didn't want to publish another PhET-iO simulation with pickableProperty, and instead want to use inputEnabled now. Marking as blocking.

@zepumph
Copy link
Member Author

zepumph commented Mar 11, 2021

At PhET-iO meeting today, we determined that Gravity and Orbits will not need to have pickableProperty removed. So we will just do this on master.

@zepumph
Copy link
Member Author

zepumph commented Mar 12, 2021

Now that #1116 and #1175 have been committed to, we can mark this off hold.

@zepumph
Copy link
Member Author

zepumph commented Mar 17, 2021

Questions for the future:

  • Should we be able to pass in a pickableProperty, even though it will never be PhET-iO instrumented? That isn't currently supported in Node by anything (in other words: the only TinyForwardingProperties are those which support PhET-iO instumentation). For example, you can't pass in a Property to be a Node's opacityProperty. So should pickableProperty be converted back (downgraded) to a TinyProperty, which can't be overridden (like opacity), or should we still allow setPickableProperty( myProperty ).
    • TODO: If we keep as, we should write tests, for phet brand, that work for a TinyStaticProperty for setting it/getting it, regardless of phetioInstrumented status.
  • I noticed that there aren't getters for *PhetioInstrumented boolean options. Should there be? I think "no", but maybe?

@zepumph
Copy link
Member Author

zepumph commented Mar 18, 2021

Initial work has been done. Co-assigning @arouinfar to review https://github.com/phetsims/phet-io-client-guides/commit/c96920e0c93a7bbbe5730ea5998f8245f6bb4146

From here I will watch CT and report issues. @samreid can you review, and discuss the questions above?

@zepumph
Copy link
Member Author

zepumph commented Mar 18, 2021

There are cases where instrumentation was relying on pickableProperty, like in

https://github.com/phetsims/ph-scale/blob/c7bfbd28343a7766dbab588074902178d65ddc09/js/common/view/graph/GraphIndicatorNode.js#L179-L184

@pixelzoom will want to review his sims to make sure these get changed also.

@arouinfar
Copy link

@zepumph it looks like find/replace all worked for client guides. I read through https://github.com/phetsims/phet-io-client-guides/commit/c96920e0c93a7bbbe5730ea5998f8245f6bb4146 and everything looks really good. Since this isn't something we'll be cherry-picking into release branches, I don't think we'll need to make any further changes to client guides. Thanks for taking care of the edits! Not sure if there is anything else left for this issue, so back to you @zepumph.

@arouinfar arouinfar assigned zepumph and unassigned arouinfar Mar 18, 2021
@zepumph zepumph changed the title Uninstrument Node.pickableProperty in exchange for Node.interactiveProperty Uninstrument Node.pickableProperty in exchange for Node.inputEnabledProperty Mar 18, 2021
@pixelzoom
Copy link
Contributor

@pixelzoom will want to review his sims to make sure these get changed also.

Tracking in sim-specific issues, as linked above.

@pixelzoom pixelzoom removed their assignment Mar 18, 2021
@zepumph
Copy link
Member Author

zepumph commented Mar 25, 2021

Over to @samreid for review.

@zepumph zepumph removed their assignment Mar 25, 2021
@samreid
Copy link
Member

samreid commented Mar 29, 2021

I skimmed through the commits and did not see any trouble.

Should we be able to pass in a pickableProperty, even though it will never be PhET-iO instrumented?

Here are some Properties that look like they can be passed in (I'm searching for setTargetProperty)

  • visibleProperty
  • pickableProperty
  • enabledProperty

PhET-iO instrumentation seems independent from whether you should be able to pass in a Property. It seems like it would round out the API to be able to pass in a pickableProperty, even if we use that rarely. It looks like pickableProperty is listed in the mutation keys, and the setter seems wired up properly, so I don't understand why it isn't already possible to pass in a pickable property. If it really is not currently supported, what are the drawbacks of adding support for that?

I noticed that there aren't getters for *PhetioInstrumented boolean options. Should there be? I think "no", but maybe?

I think if someone called myNode.enabledPropertyPhetioInstrumented and got back a falsy value of undefined, it could be confusing and difficult to debug, so it would be nice to add the getters.

@samreid samreid assigned zepumph and unassigned samreid Mar 29, 2021
zepumph added a commit to phetsims/axon that referenced this issue Apr 1, 2021
@zepumph
Copy link
Member Author

zepumph commented Apr 1, 2021

Getters added above. I am going to create a new issue for being able to pass in Properties for Node Properties that don't currently support PhET-iO.

@zepumph
Copy link
Member Author

zepumph commented Apr 1, 2021

I created #1194, 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