From 90a0029ce9b643286d6c73cccf27fbb63bbb546e Mon Sep 17 00:00:00 2001 From: martin veillette Date: Tue, 23 Jun 2026 16:35:46 -0400 Subject: [PATCH] refactor: use optionize for SimScreen options MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace hand-spread option-merging forwarded to super() with optionize(), matching MazeGame's reference pattern (CONVENTIONS ยง8). This is the template every sim is generated from, so new sims inherit the optionize pattern. Co-Authored-By: Claude Opus 4.8 --- src/sim-screen/SimScreen.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/sim-screen/SimScreen.ts b/src/sim-screen/SimScreen.ts index d2083bb..a1dfb85 100644 --- a/src/sim-screen/SimScreen.ts +++ b/src/sim-screen/SimScreen.ts @@ -8,6 +8,7 @@ * For multi-screen simulations, duplicate this file (e.g. IntroScreen.ts, * LabScreen.ts) and add each screen to the screens array in src/main.ts. */ +import { type EmptySelfOptions, optionize } from "scenerystack/phet-core"; import type { ScreenOptions } from "scenerystack/sim"; import { Screen } from "scenerystack/sim"; import type { Tandem } from "scenerystack/tandem"; @@ -29,11 +30,13 @@ export class SimScreen extends Screen { new SimScreenView(model, { tandem: options.tandem.createTandem("view"), }), - { - backgroundColorProperty: SimColors.backgroundColorProperty, - createKeyboardHelpNode: () => new SimKeyboardHelpContent(), - ...options, - }, + optionize()( + { + backgroundColorProperty: SimColors.backgroundColorProperty, + createKeyboardHelpNode: () => new SimKeyboardHelpContent(), + }, + options, + ), ); } }