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

Allow to add multiple values in dataset filters modal #689

Closed
zonia3000 opened this issue Jan 13, 2025 · 11 comments
Closed

Allow to add multiple values in dataset filters modal #689

zonia3000 opened this issue Jan 13, 2025 · 11 comments

Comments

@zonia3000
Copy link
Collaborator

In the dataset page it should be possible to define a list of values for a given attribute filter key.

This could be implemented allowing to specify multiple times the same key:

image

Notice that this is currently not supported, since we are checking for duplicate keys:

image

Moreover, we should deny the creation of lists containing different types (e.g. not mixing strings and number).

At the moment we are supporting only the creation of lists containing a single value from this UI.

@jluethi
Copy link
Collaborator

jluethi commented Jan 13, 2025

We'll want to do a revision of this interface, especially given that we'll also use a similar view of the image list in the submission dialogue. I would imagine we use something more like the dropdowns in the image list.

One functionality we may drop in this context is being able to filter for attributes that don't exist yet from the front-end. If we limit potential filters to just select from existing attributes, we already know the type of an attribute, we will already know all the potential values etc.

@zonia3000
Copy link
Collaborator Author

limit potential filters to just select from existing attributes

There is a possible edge case that I don't know how to handle.

Suppose to have an image with an attribute having key = k1 and value = v1. Then, the user opens the dataset filters modal and add an attribute filter selecting k1 and v1 from the dropdown selectors that have been built based on the image page. After that, the user removes the image and opens the dataset filters modal again. The modal is not able to list k1 and v1 in the dropdown menus, because these values don't exist anymore.

Should I just ignore them and not display them to the UI?

Another possibility could be to let the backend removing the invalid dataset filters when an image is deleted.

@zonia3000
Copy link
Collaborator Author

New modal preview:

image

@jluethi
Copy link
Collaborator

jluethi commented Jan 14, 2025

Removal of image list entries should be rare. If we do hit that edge case, it's a good question on how we want to proceed.

If we just keep the filter in place, it shouldn't interfere with any functionality. Because these attribute filters are "OR" inclusion filters, having e.g. 10 entries, only 9 of which really exist for key k wouldn't be an issue.
If all entries with key k are removed, that's a different story, but that should be super rare.

Thus, when an entry gets removed, I don't have a strong opinion on whether we keep showing the filter values. We'll always have to show all filter keys though.


Re interface:
For the job submission, I suggest we include the filtering directly in the image list modal we show there. e.g. a user uses the dropdowns there to create a filtered version of the image list and whatever filters they applied is what will be used. If we have that interface, I wonder whether it will be simpler than a separate filter modal. I could imagine that we have the following on the dataset page:
We see the image list with all images vs. filters applied. A user can add new filters interactively and there could be a "save current selection" or "apply current filters to dataset" that then saves the filters currently selected as the dataset filters.

@tcompa
Copy link
Collaborator

tcompa commented Jan 15, 2025

Re interface:
For the job submission, I suggest we include the filtering directly in the image list modal we show there. e.g. a user uses the dropdowns there to create a filtered version of the image list and whatever filters they applied is what will be used. If we have that interface, I wonder whether it will be simpler than a separate filter modal. I could imagine that we have the following on the dataset page:
We see the image list with all images vs. filters applied. A user can add new filters interactively and there could be a "save current selection" or "apply current filters to dataset" that then saves the filters currently selected as the dataset filters.

A small question came up while reviewing this plan:

Out of the two possible options ("all images" or "dataset filters" - see screenshot below), which one(s) should include the "save these filters into the dataset" button?

image

@jluethi
Copy link
Collaborator

jluethi commented Jan 15, 2025

Out of the two possible options ("all images" or "dataset filters" - see screenshot below), which one(s) should include the "save these filters into the dataset" button?

Hmm, that's a good question. It seems natural to be able to modify the dataset filters and then save them.
When a user modifies filters on all images and they save, would that overwrite all pre-existing dataset filters? That would be an unexpected interaction. So I'd argue against making it available there.
Just not showing anything in the interface unless a user selects the dataset filters view makes the feature very hidden though. And I'm not fully sure how to handle that yet.

@jluethi
Copy link
Collaborator

jluethi commented Jan 15, 2025

=> the "save these filters into the dataset" button should be available only for the "Dataset filters" option I guess. But we may want to think a bit further into how we make this something users can find.

Some options are:

  • And "Edit filters" button next to info that just sends users to the dataset filters page as well?
  • We show the button anyway, but make it always greyed out?
  • We show the button and when it's clicked, we'd ask for confirmation to overwrite existing dataset filters? (not a huge fan of that)

@zonia3000
Copy link
Collaborator Author

The new "Edit filters" button

Image

Clicking on the "Edit filters" button has the same effect of clicking on the "Dataset filters" button; the "Edit filters" button is replaced by a "Save filter" button; this button is disabled if there are no changes to save:

Image

The user can play with filters. When "Apply" is clicked the "Save filter" button becomes enabled:

Image

Then, when filters are saved:

Image

@jluethi
Copy link
Collaborator

jluethi commented Jan 16, 2025

This is an interesting approach for it!

I don't think placing the save filters button at the top makes sense anymore in this logic though. To me, save filters should be next to Apply & Reset.

An alternative approach for the "All images" mode would then be to just have a greyed out "Save filters" with hover text like "Filters can only be saved in the "Dataset filters" mode"?

@jluethi
Copy link
Collaborator

jluethi commented Jan 16, 2025

Let's not show any filter edit buttons on the "All images" modal

Let's rename the "Dataset filters" modal to:
"Current images"
"Current filtered images"
"Filtered images"
"Current selection"

Potentially with a hover help message: "These are default selection for images on which a workflow will be run"

"Save filters" becomes "Save".
"Save" should have a confirmation dialogue:
As in: This will change which filters are applied by default when running a workflow on this dataset"

Let's also show a readme view of filters in info

@tcompa
Copy link
Collaborator

tcompa commented Jan 28, 2025

I moved the remaining open question to #708, and I'm closing this one.

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

No branches or pull requests

3 participants