phetsims / sun

User-interface components for PhET simulations, built on top of Scenery.
MIT License
4 stars 12 forks source link

Dynamic layout bug in AccordionBox #848

Open pixelzoom opened 1 year ago

pixelzoom commented 1 year ago

There appears to be a bug in the dynamic layout of AccordionBox. If it's content becomes invisible (or maybe if it's content has no bounds?) the entire AccordionBox becomes invisible.

To reproduce:

  1. Run Graphing Quadratics in Studio.
  2. Got to the Standard Form screen, and note that this AccordionBox appears on the screen. It's phetioID isgraphingQuadratics.standardFormScreen.view.equationAccordionBox.
screenshot_2636
  1. Set these Properties to false:

graphingQuadratics.standardFormScreen.view.equationAccordionBox.interactiveEquationNode.visibleProperty graphingQuadratics.standardFormScreen.view.equationAccordionBox.buttonGroup.visibleProperty

... and note that equationAccordionBox becomes invisible.

@arouinfar FYI. I don't think this needs to be blocking, because it's not useful to hide the entire contents of an AccordionBox. But it is confusing when the AccordionBox disappears, so I've labeled with "high" priority.

arouinfar commented 1 year ago

@arouinfar FYI. I don't think this needs to be blocking, because it's not useful to hide the entire contents of an AccordionBox. But it is confusing when the AccordionBox disappears, so I've labeled with "high" priority.

I don't think it's blocking, either. This seems like an extension of how we deal with panels. If a panel's children are all hidden, the panel will disappear. You can see this in action with greenhouseEffect.wavesScreen.view.observationWindow.instrumentVisibilityPanel.checkboxGroup.energyBalanceCheckbox.visibleProperty (a panel with only one child).

It feels a bit strange in AccordionBox because it will disappear while its ExpandCollapseButton is still visible.

pixelzoom commented 1 year ago

If a panel's children are all hidden, the panel will disappear.

That seems fine for Panel, since there would be nothing to display other than a border and fill color.

It feels a bit strange in AccordionBox because it will disappear while its ExpandCollapseButton is still visible.

That's my feeling too. An AccordionBox is not empty when it's content is hidden. It still has a title and ExpandCollapseButton.