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

Create a broader supertype for GroupSort view #887

Open
marlitas opened this issue Nov 14, 2024 · 1 comment
Open

Create a broader supertype for GroupSort view #887

marlitas opened this issue Nov 14, 2024 · 1 comment

Comments

@marlitas
Copy link
Contributor

I discussed the alt-input interaction for the location based objects in Number Pairs with @zepumph. There are ways in which the newly created GroupSortInteraction would work well for the use case, and ways in which it would not. Mainly, GroupSortInteraction is really only made to handle 1D movement of items, while the location based objects in Number Pairs require 2D movement.

We both agreed that for navigating a group of objects within one tab stop is a common PhET pattern, therefore creating common code support for this pattern is appropriate.

After looking through GroupSortInteractionModel together we both agreed the class is general enough to cover both 1D and 2D scenarios. Therefore GroupSortInteractionModel can remain as-is.

GroupSortInteractionView will become a subtype of GroupSelectView that adds on the keyboard listeners, as well as other logic that constricts use cases to 1D scenarios.

@marlitas
Copy link
Contributor Author

I did a first pass at this. So far I have not scene any buggy behavior. The use cases so far are in Center and Variability, and Mean: Share and Balance.

I also renamed GroupSortInteractionModel to GroupSelectModel since it is now more broad. However, there are a couple of class properties that I feel should also be renamed, for example hasMouseSortedGroupItem no longer feels appropriate if perhaps the action is not to sort but to drag, or to press, or to etc. I had difficulty thinking of an term to swap "sort" out with. The first thing that came to mind was "interact" but that also felt potentially overloaded with the name that's been adopted of "Group Sort Interaction" which is now a subtype interaction.

When chatting with @zepumph he request he not be the main reviewer on this since he is busy with some other work. It feels appropriate for @pixelzoom to review and be part of continued discussions. I am assuming this is @pixelzoom's first time working with Group Sort Interaction since it has only been implemented in two sims, so I am happy to connect synchronously first if that would be helpful.

Either way I think this is now in a place where the super type is usable for Number Pairs while still allowing space for changes.

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

2 participants