-
Notifications
You must be signed in to change notification settings - Fork 12
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
Updates to instrumentation of scenery listeners #1676
Comments
These were some of the items discussed by the phet-io team, by @samreid and I independently, and by me while implementing. I think it would be good to review this together. |
|
This patch restores the emit button for Subject: [PATCH] Use PhetioIDUtilsModule, see https://github.com/phetsims/tandem/issues/316
---
Index: js/PhetioElementView.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/PhetioElementView.ts b/js/PhetioElementView.ts
--- a/js/PhetioElementView.ts (revision fa325b5800ad17739855f7f90912970587683ca8)
+++ b/js/PhetioElementView.ts (date 1734386778920)
@@ -673,7 +673,7 @@
return div;
},
- EmitterIO( phetioElementView: PhetioElementView ) {
+ 'EmitterIO<>'( phetioElementView: PhetioElementView ) {
const phetioElement = phetioElementView.phetioElement;
const div = creators.NodeIO( phetioElementView );
|
This patch is likely what was intended for the Subject: [PATCH] Use PhetioIDUtilsModule, see https://github.com/phetsims/tandem/issues/316
---
Index: js/common/view/PlayButtonGroup.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/common/view/PlayButtonGroup.ts b/js/common/view/PlayButtonGroup.ts
--- a/js/common/view/PlayButtonGroup.ts (revision ff948a96c9fe819eb78591281b69de3729110577)
+++ b/js/common/view/PlayButtonGroup.ts (date 1734387307472)
@@ -152,9 +152,9 @@
cornerRadius: 5,
xMargin: 12,
yMargin: 8,
- phetioReadOnly: true, // because sim state controls when this button is visible
visiblePropertyOptions: {
- phetioFeatured: false
+ phetioFeatured: false,
+ phetioReadOnly: true // because sim state controls when this button is visible
},
enabledPropertyOptions: {
phetioFeatured: false |
I opened phetsims/natural-selection#366 and assigned to @pixelzoom |
potential goal
TO DO:
Subject: [PATCH] Add validateLinkedElementInstrumentation to RoundToggleButton linked property, see https://github.com/phetsims/scenery-phet/issues/890
---
Index: sun/js/buttons/RectangularPushButton.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/sun/js/buttons/RectangularPushButton.ts b/sun/js/buttons/RectangularPushButton.ts
--- a/sun/js/buttons/RectangularPushButton.ts (revision 445b94cec3812a6d1c4130cb8ba9958fc01f45e2)
+++ b/sun/js/buttons/RectangularPushButton.ts (date 1736292120164)
@@ -36,7 +36,10 @@
const options = optionize<RectangularPushButtonOptions, SelfOptions, SuperOptions>()( {
soundPlayer: sharedSoundPlayers.get( 'pushButton' ),
- tandem: Tandem.REQUIRED
+ tandem: Tandem.REQUIRED,
+ listenerOptions: {
+ tandem: Tandem.OPT_OUT // PushButtonModel provides a firedEmitter which is sufficient
+ }
}, providedOptions );
// Save the listener and add it after creating the button model. This is done so that
Index: sun/js/buttons/RoundToggleButton.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/sun/js/buttons/RoundToggleButton.ts b/sun/js/buttons/RoundToggleButton.ts
--- a/sun/js/buttons/RoundToggleButton.ts (revision 445b94cec3812a6d1c4130cb8ba9958fc01f45e2)
+++ b/sun/js/buttons/RoundToggleButton.ts (date 1736291479097)
@@ -50,7 +50,11 @@
// phet-io support
tandem: Tandem.REQUIRED,
- phetioFeatured: true
+ phetioFeatured: true,
+
+ listenerOptions: {
+ tandem: Tandem.OPT_OUT
+ }
}, providedOptions );
// Note it shares a tandem with this, so the emitter will be instrumented as a child of the button
Index: joist/js/NavigationBarScreenButton.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/joist/js/NavigationBarScreenButton.ts b/joist/js/NavigationBarScreenButton.ts
--- a/joist/js/NavigationBarScreenButton.ts (revision 4f77003d219b705c52c9220f209b90c81b41e319)
+++ b/joist/js/NavigationBarScreenButton.ts (date 1736292067234)
@@ -20,6 +20,7 @@
import PhetFont from '../../scenery-phet/js/PhetFont.js';
import { Color, Node, NodeOptions, Rectangle, Text, VBox, Voicing, VoicingOptions } from '../../scenery/js/imports.js';
import PushButtonModel from '../../sun/js/buttons/PushButtonModel.js';
+import Tandem from '../../tandem/js/Tandem.js';
import HighlightNode from './HighlightNode.js';
import joist from './joist.js';
import { AnyScreen } from './Screen.js';
@@ -145,7 +146,7 @@
// Hook up the input listener
const pressListener = this.buttonModel.createPressListener( {
- tandem: options.tandem.createTandem( 'pressListener' )
+ tandem: Tandem.OPT_OUT // PushButtonModel provides a firedEmitter which is sufficient
} );
this.addInputListener( pressListener );
Index: sun/js/buttons/RectangularToggleButton.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/sun/js/buttons/RectangularToggleButton.ts b/sun/js/buttons/RectangularToggleButton.ts
--- a/sun/js/buttons/RectangularToggleButton.ts (revision 445b94cec3812a6d1c4130cb8ba9958fc01f45e2)
+++ b/sun/js/buttons/RectangularToggleButton.ts (date 1736292120088)
@@ -49,7 +49,11 @@
// phet-io support
tandem: Tandem.REQUIRED,
- phetioFeatured: true
+ phetioFeatured: true,
+
+ listenerOptions: {
+ tandem: Tandem.OPT_OUT // PushButtonModel provides a firedEmitter which is sufficient
+ }
}, providedOptions );
// Note it shares a tandem with this, so the emitter will be instrumented as a child of the button
Index: sun/js/buttons/RoundPushButton.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/sun/js/buttons/RoundPushButton.ts b/sun/js/buttons/RoundPushButton.ts
--- a/sun/js/buttons/RoundPushButton.ts (revision 445b94cec3812a6d1c4130cb8ba9958fc01f45e2)
+++ b/sun/js/buttons/RoundPushButton.ts (date 1736292120106)
@@ -37,7 +37,10 @@
const options = optionize<RoundPushButtonOptions, SelfOptions, SuperOptions>()( {
soundPlayer: sharedSoundPlayers.get( 'pushButton' ),
- tandem: Tandem.REQUIRED
+ tandem: Tandem.REQUIRED,
+ listenerOptions: {
+ tandem: Tandem.OPT_OUT // PushButtonModel provides a firedEmitter which is sufficient
+ }
}, providedOptions );
// Save the listener and add it after creating the button model. This is done so that
Index: joist/js/JoistButton.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/joist/js/JoistButton.ts b/joist/js/JoistButton.ts
--- a/joist/js/JoistButton.ts (revision 4f77003d219b705c52c9220f209b90c81b41e319)
+++ b/joist/js/JoistButton.ts (date 1736292120199)
@@ -16,6 +16,7 @@
import ButtonInteractionState from '../../sun/js/buttons/ButtonInteractionState.js';
import PushButtonInteractionStateProperty from '../../sun/js/buttons/PushButtonInteractionStateProperty.js';
import PushButtonModel from '../../sun/js/buttons/PushButtonModel.js';
+import Tandem from '../../tandem/js/Tandem.js';
import HighlightNode from './HighlightNode.js';
import joist from './joist.js';
@@ -115,7 +116,7 @@
// Hook up the input listener
this._pressListener = this.buttonModel.createPressListener( {
- tandem: options.tandem.createTandem( 'pressListener' )
+ tandem: Tandem.OPT_OUT // PushButtonModel provides a firedEmitter which is sufficient
} );
this.addInputListener( this._pressListener );
|
|
I made #1680 for specific |
With this patch, I can go to Buoyancy and fire a radio button like so:
That said, I don't recommend this as a change. I believe that we are done with the list of items found from @samreid and I partial co-review. Let's meet back up and discuss what is left for this issue. |
I went through this issue with @samreid, we are in agreement about the core state of things:
Everything else is in side issues, and we are ready to close |
From phetsims/sun#914
fireListener
, because we want 'firedEmitter' to be top level.The text was updated successfully, but these errors were encountered: