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

Add an "array strategy" for first 3 screens #334

Closed
Tracked by #1134
amanda-phet opened this issue Jul 31, 2024 · 8 comments
Closed
Tracked by #1134

Add an "array strategy" for first 3 screens #334

amanda-phet opened this issue Jul 31, 2024 · 8 comments

Comments

@amanda-phet
Copy link
Contributor

Nancy noticed that when was trying to set the cup or plate values before they were visible, weird things happened (the default values overwrote the values she set, and some bars/apples became visible when they shouldn’t have).

@marlitas @Nancy-Salpepi and I discussed this and would like to move ahead with this idea, which @arouinfar approved of:

Create an "array strategy” (similar to kickDistributionStrategy) as a new element in the tree that lets the user set all cup/plate values, even if they aren’t visible. This would allow someone to pre-set all values for any screen even before they are visible. We would also change tableSnackNumberProperty to be read-only.

@Nancy-Salpepi
Copy link

tagging phetsims/qa#1121

@marlitas
Copy link
Contributor

marlitas commented Aug 2, 2024

This is ready for @amanda-phet to review.

@marlitas
Copy link
Contributor

It looks like @amanda-phet accidentally added feedback for this issue elsewhere. Here is what she said.

It's a little funky... For example, I set meanShareAndBalance.levelOutScreen.model.initialWaterLevelsProperty and the cups didn't come out how I set them, but I clicked reset and Set Value a few times and eventually things worked out. I think if I was more methodical I could figure out the sequence, but my overall question is just if clicking 'Set Value' should immediately set the value of all 7 cups, which I think it should, and that's not happening.

It seems to be working well on the Distribute and Faire Share screens!

@amanda-phet let me know if I put the feedback in the wrong issue.

@marlitas marlitas self-assigned this Aug 12, 2024
@marlitas
Copy link
Contributor

I met with @amanda-phet and we found a way to reproduce:

  1. Navigate to the Level Out Screen in Studio.
  2. Set meanShareAndBalance.levelOutScreen.model.initialWaterLevelsProperty to: [ 0.75,0.5,0,0.65,0.9,0.35,0.75]
  3. Add a third cup in the sim. Notice that the third cup is not a value of 0.

@marlitas
Copy link
Contributor

Due to a small oversight I was not iterating over all cups, only active cups which was causing the behavior. That should be fixed. @amanda-phet can you take a look now and make sure behavior is as expected? I can then mark for cherry-pick.

@marlitas marlitas assigned amanda-phet and unassigned marlitas Aug 12, 2024
@amanda-phet
Copy link
Contributor Author

It's working! Thanks!

@amanda-phet amanda-phet assigned marlitas and unassigned amanda-phet Aug 12, 2024
@marlitas
Copy link
Contributor

Great! Ready for cherry-pick.

@Nancy-Salpepi
Copy link

The array strategies are working nicely! Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants