Closed Nancy-Salpepi closed 2 years ago
@arouinfar thoughts on how this should work? This is how modes control what blocks are showing up (it changed from being created dynamically, because we needed the blocks to always exist for phet-io).
Nice catch @Nancy-Salpepi!
@jonathanolson this looks analogous to https://github.com/phetsims/density/issues/104. There needs to be a way to hide individual blocks that isn't overridden by the model when switching between the radio button options.
@arouinfar I'd need more information about how this should work... it seems like there are three settings for some override:
Should this be discussed at phet-io meeting?
@jonathanolson a block should only be visible if the appropriate radio button option is selected and the block's visibleProperty is true.
For example, Bock 1A is visible if the value of density.mysteryScreen.model.blockSets.blockSetProperty
is SET_1 and density.mysteryScreen.model.blockSets.set1.block1A.visibleProperty
is true. If the user sets block1A.visibleProperty
to false, it would not appear when "Set 1" is selected.
Force visible (block is there even if it would be otherwise hidden)
This should never be possible. A block is visible if (and only if) the appropriate blockSetProperty
is selected and its visibleProperty
is true. Currently, the model will set the visibleProperty
when the blockSetProperty
changes, but there should be a way for users to essentially turn off certain blocks so that they never appear.
Implemented discussed changes above. Added the main modeProperty to the first screen, and swapped the visibleProperty so there's a hidden internal one AND a studio-visible one.
@arouinfar can you try it out?
@jonathanolson the block visibility is behaving great in master. The only thing that looks a bit strange to me is the modeProperty
. I thought the goal of introducing this property was to have it power the blocks RadioButtonGroup rather than using the visibleProperty
of the 2nd block.
Changing the value of modeProperty
in the Studio interface will change the state of the blocks RadioButtonGroup, but the reverse isn't true. If I change select a radio button in the sim, the modeProperty
doesn't update to match.
@arouinfar this was definitely buggy before. I believe it's fixed up in master now, can you verify?
Thanks @jonathanolson the modeProperty
is now behaving as expected in Studio. Back to you to decide if this should be closed or verified in the next QA cycle.
Thanks! Closing.
Test device MacBook Air (m1 chip)
Operating System 12.0.1
Browser safari15
Problem description For https://github.com/phetsims/qa/issues/738 in Studio Wrapper:
On the Mystery Screen, a block will reappear when its visible property is set to false. This happens with all Sets.
Steps to reproduce Here is one example:
Visuals