Open amanda-phet opened 6 months ago
Some patches from today's meeting demos:
The simulation instantiates a ToggleNode to swap between the control and the alternate display.
PRO: The alternate display is fully customizable (not limited to predetermined customizations in common code) PRO: The alternate display is extrinsic to the component, thus avoiding complication of the component itself CON: Code duplication CON: Reliance on convention to match tandems, tree structure, and behavior
In this patch, the number is left opaque when disabled:
PRO: Reuse/redefine enabledProperty instead of adding a separate Property PRO: Very lightweight CON: Do we always want arrowheads? CON: Would this strategy work in other components? CON: Would it be inconsistent for some of our components to be grayed out when disabled and others not be fully grayed out?
UPDATE FROM MK: I think this is a slightly better patch for the enabled + black number change:
https://github.com/phetsims/phet-io/issues/1757 https://github.com/phetsims/sun/issues/451 https://github.com/phetsims/sun/issues/617
We would like a displayOnlyProperty` in PhET-iO studio so we can display the value of a number picker without just using enabledProperty. Using enabledProperty can make the values hard to read.
@pixelzoom said: we shouldn't design this based on how we want it to appear in one situation and surgically remove specific components. Instead we should replace it with a preferred component (e.g. a simple box with a stroke, fill, rounded corners), and reuse that wherever we have other components that have displayOnlyProperty.
This would be its own component (called
displayPanel
for example) that you could choose to use in place of a different component (numberPicker, comboBox, etc.).@kathy-phet wonders if it could inherit characteristic of the component it's replacing. @pixelzoom says we shouldn't do that.
How much are we trying to optimize the design and user experience?
if we create a displayOnlyProperty for every common code component, need to test for it, account for dynamic layout, etc.
@samreid is wondering if we really need to bake this into the common code property, and instead just define it when needed. We wonder if this will create duplication, inconsistent experiences.
Desired things we can customize for
displayOnlyProperty
Which components would benefit from this
displayOnlyProperty
being used? (Listed a few below, but for now we'd like to just start with number-related components)Having this ability for numbers seems high value for clients. Not sure about other components.
Can our goals be achieved using enabledProperty? Perhaps the text and/or number doesn't dim, only the interactive controls do? Make sure the value is clearly readable?
@amanda-phet brought up that number pickers are in a LOT of math sims, and having a displayOnlyProperty would be really nice and improve the designer experience when trying to set up problems where we might want only a subset of pickers interactive and others not interactive.
To decide ASAP: is this blocking Mean: Share and Balance? Or should this be addressed in a future sim? If there is a sim on deck that will benefit from this added value we could address it with that sim. We could do a sim-specific implementation for MSaB and not address this in the common code yet.
There is a precedent for addressing something in a future sim when we know we have time for it. @zepumph said this was not an ideal workflow.
For MSaB: We are leaning toward an option in enabledProperty that hides the arrows (feels too much like visibleProperty), or grays out the arrows and not the number value (works in this context, but might not generalize), or darkens the number when setting enabledProperty to false (node is handling this right now, so not sure about this). Decision: Let's make a numberPicker subclass in MSaB that overrides numberPicker and see what problems we run into.
Bottom line: we are spending a lot of time over-designing features that we don't have clients asking for yet, but we are going to move forward anyway because we have designers asking for this.