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

Assertion errors when changing density for custom material inside bottle #409

Open
Nancy-Salpepi opened this issue Sep 18, 2024 · 2 comments
Assignees
Labels
dev:phet-io type:bug Something isn't working

Comments

@Nancy-Salpepi
Copy link

Nancy-Salpepi commented Sep 18, 2024

Test device
MacBook Air M1 chip

Operating System
15.0

Browser
Safari 18.0

Problem description
For phetsims/qa#1141 in Studio on the Applications screen, assertion errors will pop up in studio and in the console when changing the density of the custom material inside the bottle when the volume is 10.00L.

Steps to reproduce

  1. In studio, go to the Applications screen
  2. Move the Volume slider thumb to max value
  3. Move the Density slider thumb to the right -- errors appear
    Following the same steps in the PhET brand sim doesn't cause an error.

Visuals
Screenshot 2024-09-18 at 12 42 05 PM
Screenshot 2024-09-18 at 12 42 20 PM
Screenshot 2024-09-18 at 12 42 36 PM

@Nancy-Salpepi Nancy-Salpepi added the type:bug Something isn't working label Sep 18, 2024
@Nancy-Salpepi
Copy link
Author

Also seen using the state wrapper with ?phetioDebug=true

@zepumph
Copy link
Member

zepumph commented Oct 2, 2024

We just need to support the custom mass max in the range for the Property. @samreid can you help me get rid of the ! in this patch?

Subject: [PATCH] Node from the vbox needs to be set to invisible, https://github.com/phetsims/density-buoyancy-common/issues/415
---
Index: js/common/view/MaterialMassVolumeControlNode.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/common/view/MaterialMassVolumeControlNode.ts b/js/common/view/MaterialMassVolumeControlNode.ts
--- a/js/common/view/MaterialMassVolumeControlNode.ts	(revision 7cb3bd8a1e1115b5f3652be3508ba1f0d6a2b09c)
+++ b/js/common/view/MaterialMassVolumeControlNode.ts	(date 1727894919678)
@@ -172,7 +172,7 @@
 
     // passed to the NumberControl
     const numberControlMassProperty = new GuardedNumberProperty( massProperty.value, {
-      range: new Range( options.minMass, options.highDensityMaxMass || options.maxMass ),
+      range: new Range( options.minMass, Math.max( options.maxMass, options.maxCustomMass, options.highDensityMaxMass! ) ),
       units: 'kg',
       tandem: massNumberControlContainerTandem.createTandem( 'massProperty' ),
       phetioFeatured: true,

@zepumph zepumph assigned samreid and unassigned zepumph Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev:phet-io type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants