phetsims / projectile-data-lab

"Projectile Data Lab" is an educational simulation in HTML5, by PhET Interactive Simulations.
GNU General Public License v3.0
0 stars 0 forks source link

Incorrect options types for subclasses of VSMScreenView #216

Closed pixelzoom closed 5 months ago

pixelzoom commented 5 months ago

For code review. #32...

For example, in VariabilityScreenView.ts:

type ProjectileDataLabScreenViewOptions = SelfOptions & ScreenViewOptions;
...
export default class VariabilityScreenView extends VSMScreenView<VSMField> {
...
const options = optionize<ProjectileDataLabScreenViewOptions, SelfOptions, ScreenViewOptions>()( {}, providedOptions );

Every occurence of ScreenViewOptions should be VSMScreenViewOptions, because the superclass is VSMScreenView.

ProjectileDataLabScreenViewOptions should be VariabilityScreenViewOptions.

pixelzoom commented 5 months ago

I went ahead and fixed this in https://github.com/phetsims/projectile-data-lab/commit/18be7c64aaed0c0edcbe51b4ee71d9e70c724038. @samreid or @matthew-blackman please review, close if OK.

pixelzoom commented 5 months ago

One more minor change in https://github.com/phetsims/projectile-data-lab/commit/c95317ead272a8faf79edd74e874aebcdc9d6328. & WithRequired<PDLScreenViewOptions, 'tandem'> is redundant, simplified to & PDLScreenViewOptions,.

matthew-blackman commented 5 months ago

Good find @pixelzoom - changes look good and thanks for fixing. Reviewed and closing.