-
Notifications
You must be signed in to change notification settings - Fork 2
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 preference for percentageSubmergedVisible #126
Comments
I'll take a look at this. Self-assigning. |
I recommend a solution like this: Subject: [PATCH] Address TODOs, see https://github.com/phetsims/chipper/issues/1429
---
Index: js/common/DensityBuoyancyCommonQueryParameters.ts
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/js/common/DensityBuoyancyCommonQueryParameters.ts b/js/common/DensityBuoyancyCommonQueryParameters.ts
--- a/js/common/DensityBuoyancyCommonQueryParameters.ts (revision 0c8d369951cb271e2ae1464488db56a95af5f0c2)
+++ b/js/common/DensityBuoyancyCommonQueryParameters.ts (date 1712764806826)
@@ -11,6 +11,8 @@
export const VolumeUnitsValues = [ 'liters', 'decimetersCubed' ] as const;
export type VolumeUnits = ( typeof VolumeUnitsValues )[number];
+const defaultPercentageSubmergedVisible = phet.joist.packageJSON.name !== 'buoyancy-basics';
+
const DensityBuoyancyCommonQueryParameters = QueryStringMachine.getAll( {
gEarth: {
@@ -31,7 +33,7 @@
// Displays/hides the percentage submerged readout accordion box
percentageSubmergedVisible: {
type: 'boolean',
- defaultValue: true,
+ defaultValue: defaultPercentageSubmergedVisible,
public: true
},
@zepumph does this look good? Feel free to commit or let me know if I should. |
…ult as an additional cue to the student, see phetsims/buoyancy#126
@samreid and I got to a commit point. Using @DianaTavares, the behavior is now as follows:
Please review and feel free to close. |
Currently we don't actually have any code implemented for buoyancy basics. This is just an exact copy of the buoyancy explore screen. I wonder if we can add this to a list for when we implement the buoyancy basics sim. |
Wait. In Buoyancy, should the panel default to closed also? |
From #112. We need to be able to toggle the default of this preference based on the sim running. In Buoyancy we want the preference to default off (not showing the panel), then in buoyancy basics we do want it by default. The query parameter should still override these defaults though, so we many need to outfit a null/true/false value so we know if the query parameter was provided. Another idea is to just use
QueryStringMachine.containsKey()
to know if the value was provided vs is the default.The text was updated successfully, but these errors were encountered: