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

RegionAndCulturePortrayal instances should have consistent phetioIDs #949

Closed zepumph closed 5 months ago

zepumph commented 5 months ago

From https://github.com/phetsims/phet-io-wrappers/issues/612, I saw that it isn't going to be plug and play to support standard wrapper integration because there is no consistency about what the values of the regionAndCultureProperty could be. In center and variability right now, it can be these three options:

centerAndVariability.global.model.preferences.regionAndCulturePortrayals.kickerPortrayalUSA centerAndVariability.global.model.preferences.regionAndCulturePortrayals.kickerPortrayalAfrica centerAndVariability.global.model.preferences.regionAndCulturePortrayals.kickerPortrayalAfricaModest

I do not agree with this. I think the tandem names should match the allowed values of the query parameters. I don't believe any other portrayals have been created in phet-io sims, but marking high priority until I confirm there aren't other publications that are about to go out with this discrepancy before we talk about this more.

zepumph commented 5 months ago

I recommend this patch to proceed. It takes PhET-iO instrumentation out of the hands of the instances entirely, moves the regionAndCulturePortrayals tandem to a constant in Tandem, and ensures that the query parameter value matches the tandem name across sims.

image

```diff Subject: [PATCH] afdsaf --- Index: soccer-common/js/view/KickerPortrayal.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/soccer-common/js/view/KickerPortrayal.ts b/soccer-common/js/view/KickerPortrayal.ts --- a/soccer-common/js/view/KickerPortrayal.ts (revision e59284941ce2e212fa44a0cc00f4acf3e9ca610a) +++ b/soccer-common/js/view/KickerPortrayal.ts (date 1706214433444) @@ -11,7 +11,8 @@ import RegionAndCulturePortrayal, { RegionAndCulturePortrayalOptions } from '../../../joist/js/preferences/RegionAndCulturePortrayal.js'; import LocalizedStringProperty from '../../../chipper/js/LocalizedStringProperty.js'; import soccerCommon from '../soccerCommon.js'; -import Tandem from '../../../tandem/js/Tandem.js'; + +type KickerPortrayalOptions = RegionAndCulturePortrayalOptions; export type KickerImageSet = { standing: HTMLImageElement; @@ -19,8 +20,6 @@ kicking: HTMLImageElement; }; -export const portrayalsTandem = Tandem.PREFERENCES.createTandem( 'regionAndCulturePortrayals' ); - export default class KickerPortrayal extends RegionAndCulturePortrayal { // Keeps track of how many characters are in each set. This is only needed for unnumbered kickers. @@ -30,7 +29,7 @@ public readonly unnumberedKickerImages: KickerImageSet[], public readonly numberedKickerImages: KickerImageSet[], queryParameterValue: string, - providedOptions: RegionAndCulturePortrayalOptions ) { + providedOptions?: KickerPortrayalOptions ) { super( labelString, queryParameterValue, providedOptions ); Index: soccer-common/js/view/KickerPortrayalUSA.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/soccer-common/js/view/KickerPortrayalUSA.ts b/soccer-common/js/view/KickerPortrayalUSA.ts --- a/soccer-common/js/view/KickerPortrayalUSA.ts (revision e59284941ce2e212fa44a0cc00f4acf3e9ca610a) +++ b/soccer-common/js/view/KickerPortrayalUSA.ts (date 1706214166102) @@ -1,6 +1,6 @@ // Copyright 2023, University of Colorado Boulder -import KickerPortrayal, { portrayalsTandem } from './KickerPortrayal.js'; +import KickerPortrayal from './KickerPortrayal.js'; import player01Standing_png from '../../images/usa/player01Standing_png.js'; import player01PoisedToKick_png from '../../images/usa/player01PoisedToKick_png.js'; import player01Kicking_png from '../../images/usa/player01Kicking_png.js'; @@ -173,11 +173,6 @@ kicking: variabilityPlayer04Kicking_png } ], - USA_REGION_AND_CULTURE_ID, - { - tandem: portrayalsTandem.createTandem( 'kickerPortrayalUSA' ), - phetioState: false - } -); + USA_REGION_AND_CULTURE_ID ); export default KickerPortrayalUSA; Index: energy-skate-park/js/common/view/SkaterPortrayalLatinAmerica.js IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/energy-skate-park/js/common/view/SkaterPortrayalLatinAmerica.js b/energy-skate-park/js/common/view/SkaterPortrayalLatinAmerica.js --- a/energy-skate-park/js/common/view/SkaterPortrayalLatinAmerica.js (revision 62eb1131ee094485910b8c9b9f4dd4df9a81d6cc) +++ b/energy-skate-park/js/common/view/SkaterPortrayalLatinAmerica.js (date 1706214433448) @@ -9,12 +9,6 @@ import JoistStrings from '../../../../joist/js/JoistStrings.js'; import { LATIN_AMERICA_REGION_AND_CULTURE_ID } from '../../../../joist/js/preferences/RegionAndCulturePortrayal.js'; -import cat_headshot_png from '../../../images/usa/cat_headshot_png.js'; -import cat_left_png from '../../../images/usa/cat_left_png.js'; -import cat_right_png from '../../../images/usa/cat_right_png.js'; -import dog_headshot_png from '../../../images/usa/dog_headshot_png.js'; -import dog_left_png from '../../../images/usa/dog_left_png.js'; -import dog_right_png from '../../../images/usa/dog_right_png.js'; import skater1_headshot_png from '../../../images/latin-america/skater1_headshot_png.js'; import skater1_left_png from '../../../images/latin-america/skater1_left_png.js'; import skater1_right_png from '../../../images/latin-america/skater1_right_png.js'; @@ -33,9 +27,14 @@ import skater6_headshot_png from '../../../images/latin-america/skater6_headshot_png.js'; import skater6_left_png from '../../../images/latin-america/skater6_left_png.js'; import skater6_right_png from '../../../images/latin-america/skater6_right_png.js'; -import { portrayalsTandem } from '../model/EnergySkateParkPreferencesModel.js'; -import SkaterPortrayal from './SkaterPortrayal.js'; +import cat_headshot_png from '../../../images/usa/cat_headshot_png.js'; +import cat_left_png from '../../../images/usa/cat_left_png.js'; +import cat_right_png from '../../../images/usa/cat_right_png.js'; +import dog_headshot_png from '../../../images/usa/dog_headshot_png.js'; +import dog_left_png from '../../../images/usa/dog_left_png.js'; +import dog_right_png from '../../../images/usa/dog_right_png.js'; import SkaterImageSet from './SkaterImageSet.js'; +import SkaterPortrayal from './SkaterPortrayal.js'; const latinAmericaString = JoistStrings.preferences.tabs.localization.regionAndCulture.portrayalSets.latinAmericaStringProperty; @@ -49,10 +48,6 @@ new SkaterImageSet( skater6_left_png, skater6_right_png, skater6_headshot_png ), new SkaterImageSet( cat_left_png, cat_right_png, cat_headshot_png ), new SkaterImageSet( dog_left_png, dog_right_png, dog_headshot_png ), - LATIN_AMERICA_REGION_AND_CULTURE_ID, - { - tandem: portrayalsTandem.createTandem( 'skaterPortrayalLatinAmerica' ), - phetioState: false - } ); + LATIN_AMERICA_REGION_AND_CULTURE_ID ); export default SkaterPortrayalLatinAmerica; \ No newline at end of file Index: energy-skate-park/js/common/view/SkaterPortrayalAfrica.js IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/energy-skate-park/js/common/view/SkaterPortrayalAfrica.js b/energy-skate-park/js/common/view/SkaterPortrayalAfrica.js --- a/energy-skate-park/js/common/view/SkaterPortrayalAfrica.js (revision 62eb1131ee094485910b8c9b9f4dd4df9a81d6cc) +++ b/energy-skate-park/js/common/view/SkaterPortrayalAfrica.js (date 1706214433436) @@ -32,9 +32,8 @@ import skater6_set2_headshot_png from '../../../images/africa/skater6_set2_headshot_png.js'; import skater6_set2_left_png from '../../../images/africa/skater6_set2_left_png.js'; import skater6_set2_right_png from '../../../images/africa/skater6_set2_right_png.js'; -import { portrayalsTandem } from '../model/EnergySkateParkPreferencesModel.js'; -import SkaterPortrayal from './SkaterPortrayal.js'; import SkaterImageSet from './SkaterImageSet.js'; +import SkaterPortrayal from './SkaterPortrayal.js'; const africaString = JoistStrings.preferences.tabs.localization.regionAndCulture.portrayalSets.africaStringProperty; @@ -48,11 +47,6 @@ new SkaterImageSet( skater6_set2_left_png, skater6_set2_right_png, skater6_set2_headshot_png ), new SkaterImageSet( goat_left_png, goat_right_png, goat_headshot_png ), new SkaterImageSet( elephant_left_png, elephant_right_png, elephant_headshot_png ), - AFRICA_REGION_AND_CULTURE_ID, - { - tandem: portrayalsTandem.createTandem( 'skaterPortrayalAfrica' ), - phetioState: false - } -); + AFRICA_REGION_AND_CULTURE_ID ); export default SkaterPortrayalAfrica; \ No newline at end of file Index: tandem/js/Tandem.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/tandem/js/Tandem.ts b/tandem/js/Tandem.ts --- a/tandem/js/Tandem.ts (revision d6e465fc47d03914147c1a9a74ef37ee90155684) +++ b/tandem/js/Tandem.ts (date 1706214525770) @@ -587,6 +587,11 @@ * Use this as the parent tandem for Properties that are related to sim-specific preferences. */ public static readonly PREFERENCES = Tandem.GLOBAL_MODEL.createTandem( 'preferences' ); + + /** + * Use this as the parent tandem for RegionAndCulturePortrayal instances in your sim. + */ + public static readonly PORTRAYALS = Tandem.PREFERENCES.createTandem( 'regionAndCulturePortrayals' ); } Tandem.addLaunchListener( () => { Index: energy-skate-park/js/common/view/SkaterPortrayalOceania.js IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/energy-skate-park/js/common/view/SkaterPortrayalOceania.js b/energy-skate-park/js/common/view/SkaterPortrayalOceania.js --- a/energy-skate-park/js/common/view/SkaterPortrayalOceania.js (revision 62eb1131ee094485910b8c9b9f4dd4df9a81d6cc) +++ b/energy-skate-park/js/common/view/SkaterPortrayalOceania.js (date 1706214433440) @@ -9,12 +9,9 @@ import JoistStrings from '../../../../joist/js/JoistStrings.js'; import { OCEANIA_REGION_AND_CULTURE_ID } from '../../../../joist/js/preferences/RegionAndCulturePortrayal.js'; -import cat_headshot_png from '../../../images/usa/cat_headshot_png.js'; -import cat_left_png from '../../../images/usa/cat_left_png.js'; -import cat_right_png from '../../../images/usa/cat_right_png.js'; -import dog_headshot_png from '../../../images/usa/dog_headshot_png.js'; -import dog_left_png from '../../../images/usa/dog_left_png.js'; -import dog_right_png from '../../../images/usa/dog_right_png.js'; +import skater5_headshot_png from '../../../images/asia/skater5_headshot_png.js'; +import skater5_left_png from '../../../images/asia/skater5_left_png.js'; +import skater5_right_png from '../../../images/asia/skater5_right_png.js'; import skater1_headshot_png from '../../../images/oceania/skater1_headshot_png.js'; import skater1_left_png from '../../../images/oceania/skater1_left_png.js'; import skater1_right_png from '../../../images/oceania/skater1_right_png.js'; @@ -27,15 +24,17 @@ import skater4_headshot_png from '../../../images/oceania/skater4_headshot_png.js'; import skater4_left_png from '../../../images/oceania/skater4_left_png.js'; import skater4_right_png from '../../../images/oceania/skater4_right_png.js'; -import skater5_headshot_png from '../../../images/asia/skater5_headshot_png.js'; -import skater5_left_png from '../../../images/asia/skater5_left_png.js'; -import skater5_right_png from '../../../images/asia/skater5_right_png.js'; import skater6_headshot_png from '../../../images/oceania/skater6_headshot_png.js'; import skater6_left_png from '../../../images/oceania/skater6_left_png.js'; import skater6_right_png from '../../../images/oceania/skater6_right_png.js'; -import { portrayalsTandem } from '../model/EnergySkateParkPreferencesModel.js'; -import SkaterPortrayal from './SkaterPortrayal.js'; +import cat_headshot_png from '../../../images/usa/cat_headshot_png.js'; +import cat_left_png from '../../../images/usa/cat_left_png.js'; +import cat_right_png from '../../../images/usa/cat_right_png.js'; +import dog_headshot_png from '../../../images/usa/dog_headshot_png.js'; +import dog_left_png from '../../../images/usa/dog_left_png.js'; +import dog_right_png from '../../../images/usa/dog_right_png.js'; import SkaterImageSet from './SkaterImageSet.js'; +import SkaterPortrayal from './SkaterPortrayal.js'; const oceaniaString = JoistStrings.preferences.tabs.localization.regionAndCulture.portrayalSets.oceaniaStringProperty; @@ -49,10 +48,6 @@ new SkaterImageSet( skater6_left_png, skater6_right_png, skater6_headshot_png ), new SkaterImageSet( cat_left_png, cat_right_png, cat_headshot_png ), new SkaterImageSet( dog_left_png, dog_right_png, dog_headshot_png ), - OCEANIA_REGION_AND_CULTURE_ID, - { - tandem: portrayalsTandem.createTandem( 'skaterPortrayalOceania' ), - phetioState: false - } ); + OCEANIA_REGION_AND_CULTURE_ID ); export default SkaterPortrayalOceania; \ No newline at end of file Index: energy-skate-park/js/common/model/EnergySkateParkPreferencesModel.js IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/energy-skate-park/js/common/model/EnergySkateParkPreferencesModel.js b/energy-skate-park/js/common/model/EnergySkateParkPreferencesModel.js --- a/energy-skate-park/js/common/model/EnergySkateParkPreferencesModel.js (revision 62eb1131ee094485910b8c9b9f4dd4df9a81d6cc) +++ b/energy-skate-park/js/common/model/EnergySkateParkPreferencesModel.js (date 1706214433430) @@ -22,8 +22,6 @@ static enumeration = new Enumeration( AccelerationUnits ); } -export const portrayalsTandem = Tandem.PREFERENCES.createTandem( 'regionAndCulturePortrayals' ); - class EnergySkateParkPreferencesModel { /** Index: joist/js/preferences/RegionAndCulturePortrayal.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/joist/js/preferences/RegionAndCulturePortrayal.ts b/joist/js/preferences/RegionAndCulturePortrayal.ts --- a/joist/js/preferences/RegionAndCulturePortrayal.ts (revision 8e3fee0e46d8b2f8181e2e401382dd72ac18b965) +++ b/joist/js/preferences/RegionAndCulturePortrayal.ts (date 1706214166115) @@ -68,13 +68,15 @@ import PhetioObject, { PhetioObjectOptions } from '../../../tandem/js/PhetioObject.js'; import IOType from '../../../tandem/js/types/IOType.js'; import ReferenceIO, { ReferenceIOState } from '../../../tandem/js/types/ReferenceIO.js'; -import { EmptySelfOptions } from '../../../phet-core/js/optionize.js'; +import optionize, { EmptySelfOptions } from '../../../phet-core/js/optionize.js'; import Property from '../../../axon/js/Property.js'; import Tandem from '../../../tandem/js/Tandem.js'; import packageJSON from '../packageJSON.js'; +import StrictOmit from '../../../phet-core/js/types/StrictOmit.js'; type SelfOptions = EmptySelfOptions; -export type RegionAndCulturePortrayalOptions = SelfOptions & PhetioObjectOptions; +type ParentOptions = StrictOmit; +export type RegionAndCulturePortrayalOptions = SelfOptions & ParentOptions; // Constants used for each supported region/culture export const USA_REGION_AND_CULTURE_ID = 'usa'; @@ -122,16 +124,23 @@ public constructor( label: LocalizedStringProperty, public readonly regionAndCultureID: string, // Query parameter value attached to this portrayal set - providedOptions: RegionAndCulturePortrayalOptions ) { + providedOptions?: RegionAndCulturePortrayalOptions ) { - super( providedOptions ); + const options = optionize()( { + tandem: Tandem.PORTRAYALS.createTandem( regionAndCultureID ), + phetioState: false + }, providedOptions ); + + super( options ); + assert && this.tandem?.supplied && assert( SUPPORTED_REGIONS_AND_CULTURES.includes( this.tandem.name ), + `RegionAndCulturePortrayal should have a tandem name that matches its portrayal name: ${this.tandem.name}` ); this.labelProperty = label; } public static createRegionAndCulturePortrayalProperty( regionAndCulturePortrayal: RegionAndCulturePortrayal, validValues: RegionAndCulturePortrayal[] ): Property { assert && assert( _.every( validValues, value => SUPPORTED_REGIONS_AND_CULTURES.includes( value.regionAndCultureID ) ), - `validValues regionAndCultureIDs must be a subset of RegionAndCulturePortrayal.SUPPORTED_REGIONS_AND_CULTURES, but was ${ validValues.map( value => value.regionAndCultureID ) }` + `validValues regionAndCultureIDs must be a subset of RegionAndCulturePortrayal.SUPPORTED_REGIONS_AND_CULTURES, but was ${validValues.map( value => value.regionAndCultureID )}` ); return new Property( regionAndCulturePortrayal, { Index: energy-skate-park/js/common/view/SkaterPortrayalAfricaModest.js IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/energy-skate-park/js/common/view/SkaterPortrayalAfricaModest.js b/energy-skate-park/js/common/view/SkaterPortrayalAfricaModest.js --- a/energy-skate-park/js/common/view/SkaterPortrayalAfricaModest.js (revision 62eb1131ee094485910b8c9b9f4dd4df9a81d6cc) +++ b/energy-skate-park/js/common/view/SkaterPortrayalAfricaModest.js (date 1706214433433) @@ -48,11 +48,6 @@ new SkaterImageSet( skater6_set3_left_png, skater6_set3_right_png, skater6_set3_headshot_png ), new SkaterImageSet( goat_left_png, goat_right_png, goat_headshot_png ), new SkaterImageSet( elephant_left_png, elephant_right_png, elephant_headshot_png ), - AFRICA_MODEST_REGION_AND_CULTURE_ID, - { - tandem: portrayalsTandem.createTandem( 'skaterPortrayalAfricaModest' ), - phetioState: false - } -); + AFRICA_MODEST_REGION_AND_CULTURE_ID ); export default SkaterPortrayalAfricaModest; \ No newline at end of file Index: energy-skate-park/js/common/view/SkaterPortrayalAsia.js IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/energy-skate-park/js/common/view/SkaterPortrayalAsia.js b/energy-skate-park/js/common/view/SkaterPortrayalAsia.js --- a/energy-skate-park/js/common/view/SkaterPortrayalAsia.js (revision 62eb1131ee094485910b8c9b9f4dd4df9a81d6cc) +++ b/energy-skate-park/js/common/view/SkaterPortrayalAsia.js (date 1706214433427) @@ -9,12 +9,12 @@ import JoistStrings from '../../../../joist/js/JoistStrings.js'; import { ASIA_REGION_AND_CULTURE_ID } from '../../../../joist/js/preferences/RegionAndCulturePortrayal.js'; -import goat_headshot_png from '../../../images/africa/goat_headshot_png.js'; -import goat_left_png from '../../../images/africa/goat_left_png.js'; -import goat_right_png from '../../../images/africa/goat_right_png.js'; import elephant_headshot_png from '../../../images/africa/elephant_headshot_png.js'; import elephant_left_png from '../../../images/africa/elephant_left_png.js'; import elephant_right_png from '../../../images/africa/elephant_right_png.js'; +import goat_headshot_png from '../../../images/africa/goat_headshot_png.js'; +import goat_left_png from '../../../images/africa/goat_left_png.js'; +import goat_right_png from '../../../images/africa/goat_right_png.js'; import skater1_headshot_png from '../../../images/asia/skater1_headshot_png.js'; import skater1_left_png from '../../../images/asia/skater1_left_png.js'; import skater1_right_png from '../../../images/asia/skater1_right_png.js'; @@ -33,9 +33,8 @@ import skater6_headshot_png from '../../../images/asia/skater6_headshot_png.js'; import skater6_left_png from '../../../images/asia/skater6_left_png.js'; import skater6_right_png from '../../../images/asia/skater6_right_png.js'; -import { portrayalsTandem } from '../model/EnergySkateParkPreferencesModel.js'; -import SkaterPortrayal from './SkaterPortrayal.js'; import SkaterImageSet from './SkaterImageSet.js'; +import SkaterPortrayal from './SkaterPortrayal.js'; const asiaString = JoistStrings.preferences.tabs.localization.regionAndCulture.portrayalSets.asiaStringProperty; @@ -49,10 +48,6 @@ new SkaterImageSet( skater6_left_png, skater6_right_png, skater6_headshot_png ), new SkaterImageSet( goat_left_png, goat_right_png, goat_headshot_png ), new SkaterImageSet( elephant_left_png, elephant_right_png, elephant_headshot_png ), - ASIA_REGION_AND_CULTURE_ID, - { - tandem: portrayalsTandem.createTandem( 'skaterPortrayalAsia' ), - phetioState: false - } ); + ASIA_REGION_AND_CULTURE_ID ); export default SkaterPortrayalAsia; \ No newline at end of file Index: soccer-common/js/view/KickerPortrayalAfricaModest.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/soccer-common/js/view/KickerPortrayalAfricaModest.ts b/soccer-common/js/view/KickerPortrayalAfricaModest.ts --- a/soccer-common/js/view/KickerPortrayalAfricaModest.ts (revision e59284941ce2e212fa44a0cc00f4acf3e9ca610a) +++ b/soccer-common/js/view/KickerPortrayalAfricaModest.ts (date 1706214166138) @@ -1,6 +1,6 @@ // Copyright 2023, University of Colorado Boulder -import KickerPortrayal, { portrayalsTandem } from './KickerPortrayal.js'; +import KickerPortrayal from './KickerPortrayal.js'; import player01Standing_png from '../../images/africaModest/player01Standing_png.js'; import player01PoisedToKick_png from '../../images/africaModest/player01PoisedToKick_png.js'; import player01Kicking_png from '../../images/africaModest/player01Kicking_png.js'; @@ -59,11 +59,6 @@ KickerPortrayalAfrica.numberedKickerImages[ 3 - 1 ], KickerPortrayalAfrica.numberedKickerImages[ 4 - 1 ] ], - AFRICA_MODEST_REGION_AND_CULTURE_ID, - { - tandem: portrayalsTandem.createTandem( 'kickerPortrayalAfricaModest' ), - phetioState: false - } -); + AFRICA_MODEST_REGION_AND_CULTURE_ID ); export default KickerPortrayalAfricaModest; Index: soccer-common/js/view/KickerPortrayalAfrica.ts IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/soccer-common/js/view/KickerPortrayalAfrica.ts b/soccer-common/js/view/KickerPortrayalAfrica.ts --- a/soccer-common/js/view/KickerPortrayalAfrica.ts (revision e59284941ce2e212fa44a0cc00f4acf3e9ca610a) +++ b/soccer-common/js/view/KickerPortrayalAfrica.ts (date 1706214166125) @@ -1,6 +1,6 @@ // Copyright 2023, University of Colorado Boulder -import KickerPortrayal, { portrayalsTandem } from './KickerPortrayal.js'; +import KickerPortrayal from './KickerPortrayal.js'; import player01Standing_png from '../../images/africa/player01Standing_png.js'; import player01PoisedToKick_png from '../../images/africa/player01PoisedToKick_png.js'; import player01Kicking_png from '../../images/africa/player01Kicking_png.js'; @@ -120,11 +120,6 @@ kicking: variabilityPlayer04Kicking_png } ], - AFRICA_REGION_AND_CULTURE_ID, - { - tandem: portrayalsTandem.createTandem( 'kickerPortrayalAfrica' ), - phetioState: false - } -); + AFRICA_REGION_AND_CULTURE_ID ); export default KickerPortrayalAfrica; Index: energy-skate-park/js/common/view/SkaterPortrayalUSA.js IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== diff --git a/energy-skate-park/js/common/view/SkaterPortrayalUSA.js b/energy-skate-park/js/common/view/SkaterPortrayalUSA.js --- a/energy-skate-park/js/common/view/SkaterPortrayalUSA.js (revision 62eb1131ee094485910b8c9b9f4dd4df9a81d6cc) +++ b/energy-skate-park/js/common/view/SkaterPortrayalUSA.js (date 1706214433442) @@ -33,9 +33,8 @@ import skater6_set1_headshot_png from '../../../images/usa/skater6_set1_headshot_png.js'; import skater6_set1_left_png from '../../../images/usa/skater6_set1_left_png.js'; import skater6_set1_right_png from '../../../images/usa/skater6_set1_right_png.js'; -import { portrayalsTandem } from '../model/EnergySkateParkPreferencesModel.js'; -import SkaterPortrayal from './SkaterPortrayal.js'; import SkaterImageSet from './SkaterImageSet.js'; +import SkaterPortrayal from './SkaterPortrayal.js'; const unitedStatesOfAmericaString = JoistStrings.preferences.tabs.localization.regionAndCulture.portrayalSets.unitedStatesOfAmericaStringProperty; @@ -49,10 +48,6 @@ new SkaterImageSet( skater6_set1_left_png, skater6_set1_right_png, skater6_set1_headshot_png ), new SkaterImageSet( cat_left_png, cat_right_png, cat_headshot_png ), new SkaterImageSet( dog_left_png, dog_right_png, dog_headshot_png ), - USA_REGION_AND_CULTURE_ID, - { - tandem: portrayalsTandem.createTandem( 'skaterPortrayalUSA' ), - phetioState: false - } ); + USA_REGION_AND_CULTURE_ID ); export default SkaterPortrayalUSA; \ No newline at end of file ```

@marlitas. How would you like to proceed? I don't think I should commit this without talking it through with you first.

zepumph commented 5 months ago

@marlitas and I went through the above patch and we would like to proceed with this.

We also saw that perhaps an assertion here would make sense.

https://github.com/phetsims/joist/blob/22c3231bc37c6618ffaa6cc635139927db9369a4/js/preferences/PreferencesModel.ts#L323

zepumph commented 5 months ago

We also saw that perhaps an assertion here would make sense.

See https://github.com/phetsims/joist/issues/950

zepumph commented 5 months ago

The above is basically exactly the same as the patch and what @marlitas and I went over (except a lint error and CAV migration support). So I feel good about closing this. Thanks @marlitas.