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

New dialog to select multiple items using checkboxes #1548

Merged
merged 1 commit into from
Jun 13, 2024

Conversation

carolahp
Copy link
Contributor

The new dialog is displayed below.
Its api is the same as SpSelectDialog.
Three examples were added.

image

This presenter is used in Pharo PR#16637

@demarey
Copy link
Collaborator

demarey commented May 28, 2024

This presenter is nice but it looks to be a duplicate of SpChooserPresenter.
The new dialog also misses a filter for items.

@carolahp
Copy link
Contributor Author

@demarey I think the SpChooserPresenter is designed to selecting items from a long lists (as in the image), while the presenter I propose works best for a short list of items.
image

You are right that my presenter is missing a filter. I can add it

@demarey
Copy link
Collaborator

demarey commented May 31, 2024

Hi @carolahp
I agree your presenter is better for a few items but I still think the same presenter can do both jobs:

  • present a logn list of items to select: SpChooserPresenter
  • present a short list of items to select: SpSelectMultipleDialog
    I think SpChooserPresenter could have 2 different layouts for both usage:
  • one showing twol list,
  • the other only showing one list.
    Could you have a look at SpChooserPresenter to see if it is doable. The only hard point I can see is the different behaviour when selecting items from the first list but maybe I miss something.

@carolahp
Copy link
Contributor Author

Hi @demarey
Modifying SpChoosedPresenter to do both jobs would implies:

  • Modifying the logic behind the way chosenItems are computed and displayed. When the items list is short the chosen items are the checked items in the first list, but when the items list is long the chosen items are those in the second list. I can't think of a clean way to introduce this distinction in the code, but to add many ifs
    Maybe it's just me who can't find an elegant way to implement this new behavior to SpChooserPresenter. Could you please give me your opinion?

@Ducasse Ducasse merged commit 2dc4acd into pharo-spec:Pharo13 Jun 13, 2024
1 of 2 checks passed
@carolahp carolahp deleted the selectMultipleDialog branch June 17, 2024 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants