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

Missing PhET-iO elements in Preferences dialog under simPreferences #144

Closed
pixelzoom opened this issue Aug 31, 2022 · 3 comments
Closed

Comments

@pixelzoom
Copy link
Contributor

pixelzoom commented Aug 31, 2022

Related to #140 (add support for dynamic locale), I'm running into a problem with the Preferences dialog in Studio. The sim adds one subpanel that contains a title ("Dipole direction") and a radio button group:

screenshot_1847

The subpanel is implemented in DipoleDirectionControl.js, the radio button group in DipoleDirectionRadioButtonGroup.js.

After opening the Preferences dialog, under moleculePolarity.general.view.navigationBar.preferencesButton.preferencesDialogCapsule.preferencesDialog.preferencesPanels.generalPreferencesPanel.simPreferences you'll see this subtree:

screenshot_1850

Four problems, all in DipoleDirectionRadioButtonGroup.js:

(1) DerivedProperty negativeToPositiveRadioButton.negativeToPositiveStringProperty is missing from the tree.

(2) negativeToPositiveRadioButton.labelText is missing child textProperty that links to negativeToPositiveRadioButton.negativeToPositiveStringProperty.

(3) Similar to (1), DerivedProperty positiveToNegativeRadioButton.positiveToNegativeStringProperty is missing from the tree.

(4) Similar to (2), positiveToNegativeRadioButton.labelText is missing child textProperty that links to positiveToNegativeRadioButton.positiveToNegativeStringProperty.

Am I hitting some limitation/problem with PhetioCapsule?

@pixelzoom
Copy link
Contributor Author

I thought the problem might be caused by instantiating DerivedProperty inside of a dynamic component. So I temporarily moved negativeToPositiveStringProperty and positiveToNegativeStringProperty to MPConstants. The behavior was unchanged.

pixelzoom added a commit that referenced this issue Aug 31, 2022
samreid added a commit that referenced this issue Aug 31, 2022
@samreid
Copy link
Member

samreid commented Aug 31, 2022

Fixed in the commit, please review. Also, should we convert StringUtils to TypeScript and ban certain keys/value types? But perhaps this will be better addressed in PatternStringProperty which @jonathanolson is working on.

@pixelzoom
Copy link
Contributor Author

Fixed in the commit, please review.

Oh duh, options in the wrong place... and thanks.

Also, should we convert StringUtils to TypeScript and ban certain keys/value types?

I don't think that's necessary. If Molecule Polarity had been in TypeScript (it is now), this would have been caught.

Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants