phetsims / sun

User-interface components for PhET simulations, built on top of Scenery.
MIT License
4 stars 12 forks source link

PhET-iO Design for Carousel #736

Closed arouinfar closed 2 years ago

arouinfar commented 2 years ago

Related to https://github.com/phetsims/circuit-construction-kit-common/issues/513

Here's an example of what carousel currently looks like in CCK: DC:

image

Questions:

Long-term wishlist:

Desired changes:

Assigning to @zepumph and @samreid. Happy to discuss further on a call or at PhET-iO meeting if these requests are unclear/unreasonable.

zepumph commented 2 years ago

@samreid, can you take the lead on this since you are working on this with CCK? Let me know if you would like assistance.

samreid commented 2 years ago

I completed all the requests above except for:

If possible, make pageControl a child of carousel.

There is difficulty in this request, since PageControl can be used to control any item and Carousel doesn't define how PageControl layout works. Here are some options:

My recommendation is that the current implementation is very flexible. Showing the page control outside of the carousel tandem seems reasonable to me, since they are side by side. We could introduce a carouselContainer node that contains both if the user needs one shutoff valve. But also, I don't think it's too much to ask a client to hide the carousel and the page controls if that is the desired behavior.

Ready for review and discussion.

arouinfar commented 2 years ago

@samreid I reviewed in CCK:DC, and the carousel looks great! Thanks for providing more context around PageControl. I don't think we should force it anywhere or wire it up in an unorthodox way.

We could introduce a carouselContainer node that contains both if the user needs one shutoff valve.

Currently carousel and pageControl are both children of circuitElementToolbox. Can we create circuitElementToolbox.visibleProperty?

samreid commented 2 years ago

In the commit, I instrumented circuitElementToolbox and additionally featured its visibleProperty. Let me know if that last part is not desired or if it should be in the overrides. Otherwise, ready for review and please close if all is well.

arouinfar commented 2 years ago

Thanks @samreid. I think circuitElementToolbox.visibleProperty looks good, and it should certainly be phetioFeatured: true. It seems appropriate to handle in the overrides since it is sim-specific, but I'll leave that up to you.

samreid commented 2 years ago

Sounds good, thanks! I also noted that the phetioFeatured: true is advantageous in the code since circuit-construction-kit-common is used by several sims. Closing.