phetsims / gravity-and-orbits

"Gravity And Orbits" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
12 stars 6 forks source link

Unable to hide localization tab #470

Closed Nancy-Salpepi closed 2 years ago

Nancy-Salpepi commented 2 years ago

In the client guide for RC.3, it states that a subset of tabs can be hidden. However, this element isn't in the tree: gravityAndOrbits.general.view.navigationBar.preferencesButton.preferencesDialogCapsule.preferencesDialog.preferencesTabs.LocalizationTab.visibleProperty.

This is the similar to https://github.com/phetsims/molecule-shapes/issues/230 and https://github.com/phetsims/gravity-and-orbits/issues/465

arouinfar commented 2 years ago

Thanks for reporting @Nancy-Salpepi. I checked rc.3 in Studio, and I am able to hide the Localization Tab. I think there are two possible reasons you ran into trouble:

  1. You searched for the listed phetioID without first opening the Preferences dialog, so it didn't exist. Dialogs must first be opened before they can be customized. This is mentioned earlier in the guide, but I will add a reminder to open the dialog to the "Hide All Preferences or a Subset of Preferences Tabs" section.
  2. You were viewing only the "Featured" elements and LocalizationTab.visibleProperty is currently phetioFeatured: false. I've opened https://github.com/phetsims/joist/issues/875 to feature each tab's visibleProperty.

Self-assigning to update the PhET-iO Guide.

arouinfar commented 2 years ago

I addressed (1) in the above commit, and the relevant section of the guide now reads:

To prevent access to all Preferences, hide the preferencesButton. {{simCamelCaseName}}.general.view.navigationBar.preferencesButton.visibleProperty

To prevent access to individual categories of Preferences, and then hide the associated tab. For example, the Localization tab can be hidden with {{simCamelCaseName}}.general.view.navigationBar.preferencesButton.preferencesDialogCapsule.preferencesDialog.preferencesTabs.LocalizationTab.visibleProperty

As a reminder, dialogs must first be opened before they can be customized. The above phetioID will not exist until the Preferences dialog is opened.

@Nancy-Salpepi I think this change along with making the tab's visibleProperty featured should address your original issue. If you agree, please close this issue.

Nancy-Salpepi commented 2 years ago

You're right. I didn't have the dialog open first. Thanks @arouinfar and sorry about that!