-
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
convert sims to use AquaRadioButtonGroup #555
Comments
The PhET-iO team, especially in relation to #550, is wondering if we don't want to try to move AquaRadioButton's functionality into RadioButtonGroup. This would allow us to deprecate What if there was an option like: More generally rephrasing, the above sentiment: what do we want our long term radio button api to look like (like #523)? Ideally we would have just one implementation under the hood, but we still could have two subtypes if desired. |
@zepumph I believe that's what will need to happen in order to address #523 (unify radio button group implementations), currently assigned to @chrisklus with low priority. |
Uh oh, we need to rethink this. I thought I'd try this conversion to see what problems I might run into. I immediately ran into this situation in acid-base-solutions: This is a group of 3 radio buttons. The first radio button has a related checkbox. I think this is a perfectly valid UI design, and I don't think this is an isolated example. And it's impossible to accomplish with hookes-law is similar to acid-base-solutions, where a radio button has an associated UI component. We lucked out in this case because it's associated with the bottom radio button. The other type of problem is layout. There are a number of sims that use a horizontal layout, not supported by balancing-chemical-equations: beers-law-lab: gravity-and-orbits: fluid-pressure-and-flow: I said this long ago when |
Should we discuss next steps at an upcoming developer meeting? Perhaps I should be addressing #523 at high priority. |
After discussing in the dev meeting today:
|
In #555 (comment), it was noted that AquaRadioButtonGroup has no support for interleaved UI components, a requirement for several sims. Since work/discussion on this has stalled, I've moved that to its own issue. See #583. |
This was discussed in the 3/26/2020 developer meeting, and it seems like there is significant tension between the current phet-io API design and the ability to use radio button groups in different layouts, such as the ones shown in #555 (comment). @pixelzoom was making the point that the layout and the "groupness" are separate functionalities that should not be combined into one class, which is where it stands now. We decided that this situation needs to be discussed with the phet-io designers so that we can work out a good way to separate the "groupness" from the layout, yet have it still be usable and not overly complicated in the phet-io API. I've marked the issue for the next phet-io meeting where @zepumph can bring it up. |
From a phet-io spec perspective, the nesting in the studio tree could be pretty flexible.
An important piece that should be implemented for PhET-iO is that toggling the visibility of the parent radio button should also toggle the visibility of the nested content. Implementation One way to support this would be in AquaRadioButton solely: We also discussed solving this more generally, noting that AquaRadioButtons and checkboxes are often stacked, interleaved, and nested (CAF, HL, etc). Perhaps when we work on this next, a layout manager like "VerticalFormTreeLayoutManager" that does this work for any Node tree-like structure. We decided that we would not work on this until the next time a simulation that uses these weird AquaRadioButton cases would need it. Unassigning until then. @pixelzoom edit: I modified the above options to correspond to this example in Hooke's Law, since that was the context of our phet-io meeting discussion: |
Over in #549, we decided to change how AquaRadioButtons are instrumented. Instead of associating the linked Property with each button, the linked Property will be associated with the group (as is the case for RadioButtonGroup). As noted in #549 (comment):
So all sims that are explicitly instantiating AquaRadioButtons will need to be changed to use VerticalAquaRadioButtonGroup. This presumably needs to be done immediately for instrumented sims, but could be a "chip away" for non-instrumented sims.
Here's are the lists of sims that are calling
new AquaRadioButton
, with responsible developers indicated.Instrumented, or in progress:
Not instrumented:
And perhaps we should add "new AquaRadioButton" to lint rule bad-text.js?
Labeling for dev meeting to discuss.
The text was updated successfully, but these errors were encountered: