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

Phase control buttons don't seem to turn off when deselected. #340

Open
KatieWoe opened this issue Aug 18, 2020 · 5 comments
Open

Phase control buttons don't seem to turn off when deselected. #340

KatieWoe opened this issue Aug 18, 2020 · 5 comments
Labels

Comments

@KatieWoe
Copy link
Contributor

For phetsims/qa#531. May not be important, but documenting here.
Related to client request:

Preselect the default state

The properties

statesOfMatter.statesScreen.view.solidLiquidGasPhaseControlNode.gasSelectedProperty
statesOfMatter.statesScreen.view.solidLiquidGasPhaseControlNode.liquidSelectedProperty
statesOfMatter.statesScreen.view.solidLiquidGasPhaseControlNode.solidSelectedProperty

were used as a method of doing this. I noticed that if you select, then deselect these properties, the deselection doesn't seem to work. The button no longer looks depressed, but it is still purple and you can't re-click it. If you launch like this, the button looks depressed again. If this is intended/desired behavior, feel free to close.
turnoffgasselected

@arouinfar
Copy link
Contributor

This looks buggy to me. However, the request was to set the startup state, so interacting with each SelectedProperty is not really necessary. This can be done by selecting the desired PhaseControl button in the sim and then launching from Studio.

@jbphet can you take a look and see if this is actually a bug? If this isn't a bug, I'll need to edit the client guide to remove the SelectedProperty phetioIDs.

@arouinfar arouinfar removed their assignment Aug 19, 2020
@jbphet
Copy link
Contributor

jbphet commented Aug 19, 2020

@arouinfar said:

This looks buggy to me...@jbphet can you take a look and see if this is actually a bug?

Well, I hate to get into semantics, but it depends on what you mean by a "bug". If you mean that it is a behavior that is less than ideal, then yes, it is by definition a bug. If by 'bug' you mean that it was something that was done erroneously in the code that can be quickly and easily corrected, then no, it's not. This behavior is the result of making aspects of a UI component available for manipulation when the component was not originally designed for such things. The component in question - StatesPhaseControlNode - was designed such that pressing one of the buttons sets the corresponding phase property to true, at which times the others are set to false and the appropriate adjustments are made to the model. It just wasn't designed to handle the case where one of the phase properties was set to false out of the blue without one of the others being set to true.

I tried a couple of quick-fix ideas but ran into problems with reentrancy of properties. I think the right thing to do would be to redesign StatesPhaseControlNode to better handle the new requirements that are levied on it due to phet-io, but given the time constraints of the 1.2.0 release, I don't think we can do it in time.

@arouinfar - please make the changes you described to the client guide, then assign back to me.

@arouinfar
Copy link
Contributor

@jbphet that sounds reasonable for the 1.2.0 release.

Long term, I think we'll probably want to redesign StatePhaseControlNode so clients can easily set the phase by communicating with the SelectedProperty.

@arouinfar
Copy link
Contributor

I've edited the SOM and SOMB guides in the above commits.

@jbphet
Copy link
Contributor

jbphet commented Aug 21, 2020

Unassigning until the maintenance release is designated as one of my priorities.

@jbphet jbphet removed their assignment Aug 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants