phetsims / joist

Joist is the main framework for PhET Interactive Simulations. Joist creates and displays the simulation content, home screen, navigation bar, About dialog, enables switching between tabs, and other framework-related features.
MIT License
8 stars 6 forks source link

Make Sim.topLayer private #841

Open samreid opened 1 year ago

samreid commented 1 year ago

In https://github.com/phetsims/chipper/issues/1302, @zepumph and I eliminated several usages of Sim.topLayer. There are still a few left before it can be made private like it was on 8/12/22.

zepumph commented 1 year ago

Looks like the cases are for ComboBoxes in Dialogs. I'm unsure how to support this without making the parent within the bounds of the dialog, or punting.

samreid commented 1 year ago

There are only 2 usages at the moment, and I marked them with TODOs referring to this issue. They are in VoicingPanelSection and RegionAndCultureComboBox. Technically, we can mark topLayer as private now without any type errors, since both of those usages are getting the sim through an untyped global. I'm not really sure what to do with this issue. It would be unfortunate if ComboBox has to know about joist. @zepumph recently worked on an issue to decouple common code repos from joist (even though both of these usages are in Joist, the reason they need topLayer is because of ComboBox as @zepumph pointed out).

Maybe defer this issue for if we ever work on a better "pane" system for scenery/joist/common code?