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

[Feature] Filter Compatible & Installed #3071

Closed
VasVadum opened this issue Jun 8, 2020 · 14 comments · Fixed by #3323
Closed

[Feature] Filter Compatible & Installed #3071

VasVadum opened this issue Jun 8, 2020 · 14 comments · Fixed by #3323
Labels
Enhancement New features or functionality GUI Issues affecting the interactive GUI

Comments

@VasVadum
Copy link

VasVadum commented Jun 8, 2020

Problem

Is your feature request related to a problem? Please describe.
Installed mods hidden when using filters that exclude them.

Suggestions

Describe the solution you'd like
Ability to show installed mods regardless of the filter set, for example showing Installed mods with the Compatible filter regardless of if the mod is compatible or not.

@HebaruSan HebaruSan added Enhancement New features or functionality GUI Issues affecting the interactive GUI labels Oct 15, 2020
@HebaruSan
Copy link
Member

Hmm, we could replace the dropdown for separate filters with tri-state toggles (yes/no/both) in the search dropdown for:

  • Compatible
  • Installed
  • Cached
  • Newly compatible
  • Upgradeable
  • Replaceable

The search box syntax for these could be like is:compatible, is:cached, not:installed, etc.

However, combining is:compatible and is:installed would not satisfy the original request, because by default it would be an AND search, and what's requested is an OR search (union rather than intersection). In theory a syntax like is:compatible OR is:installed seems reasonable, but how would that translate to a toggle/checkbox based UI? Same problem we have in yalov's recent comments in #2736 about wanting to see the union of a name search and a description search...

@ddanf
Copy link

ddanf commented Mar 5, 2021

I was about to make a similar request when I saw this.

One way to represent this in a GUI would be to create an advanced filter pane that shows each condition as a row where you would select the comparator and values and which conjunction (AND/OR) to use with it. An even more advanced version might allow grouping to be added, which would allow the user to make very complex filters.

As an alternative, the following canned filters would prove useful and answer the original request:
installed incompatible
installed compatible
compatible not installed

Thanks for maintaining this app - I use it all the time.

@HebaruSan
Copy link
Member

Thanks for maintaining this app - I use it all the time.

Thanks for the feedback, @ddanf!

One way to represent this in a GUI would be to create an advanced filter pane that shows each condition as a row where you would select the comparator and values and which conjunction (AND/OR) to use with it. An even more advanced version might allow grouping to be added, which would allow the user to make very complex filters.

Do you happen to know of an example application that does this, that we could look at for inspiration? I've put a fair bit of thought into how to implement this, and I get stuck at trying to determine how the conjunction toggles would work when you set them differently for different fields. For example, consider entering this in the search editor:

Field Value AND/OR
Compatible Yes AND
Installed No OR

Would that correspond logically to "Compatible AND Not Installed" or "Compatible OR Not Installed"? I could see the user expecting either one, so it's not clear to me that this approach is workable.

I think I have seen applications that solve this by forcing the user to pick one overall AND/OR setting for the whole search, which would solve this one specific example handily. But it would also make more complex searches impossible, and generally break the correspondence between the GUI dropdown controls and the pure-text search syntax. Think about searching for is:compatible not:installed is:cached and then toggling from AND to OR; the search would become is:compatible OR not:installed OR is:cached. Then if the user changes it to is:compatible OR not:installed is:cached, we now have something that such a UI simply couldn't represent, since it uses both AND and OR in different places.

Ideally we would like to address all of these cases at once, to avoid disruptive and drawn-out changes for users.

@ddanf
Copy link

ddanf commented Mar 5, 2021 via email

@ddanf
Copy link

ddanf commented Mar 5, 2021 via email

@HebaruSan
Copy link
Member

Thanks! It looks like the second example uses an overall toggle, but repeated in multiple different, nested groups?

screenshot

That's much more complex than what CKAN does today, but it definitely has the flexibility to represent any arbitrary search.

@HebaruSan
Copy link
Member

Looking for examples from Quality Center, so far I've found this, which seems to only support searching one field:

screenshot

... but maybe one of those buttons leads onward to another screen where you can add additional filters. Hard to tell.

@HebaruSan
Copy link
Member

Quality Center also has this, which lists "And", "Or", and "Not" operators on the side but doesn't show how they work. Kind of looks like it would be internal to the field ("High Or Low") rather than in between them?

list

filter

@HebaruSan
Copy link
Member

HebaruSan commented Mar 5, 2021

I'm now leaning towards...

  • Add tri-state toggle buttons to the current AND-only search system (not shown below since I think of them as already figured out); then
  • Take the current UI and effectively duplicate it; insert an "Add" button somewhere (probably to the right of the current dropdown button), which would insert a new search bar, the results of which would be OR'd with the first search bar. Kind of like:
    image

This would be backwards compatible and mostly out of the way to avoid flummoxing typical users, but if needed it could represent any Boolean expression of the form (A AND B AND ...) OR (C AND D AND ...) OR ..., and I think there's a theorem that any Boolean expression can be reduced to that form. We would not have to worry about problems with the syntax because each OR sub-expression would be its own separate search box and therefore search string; there wouldn't even need to be any OR or AND tokens in the syntax.

The OP's request would be satisfied by making two search boxes, one with is:compatible and one with is:installed. And the later comments in #2736 would likewise be two search boxes, one with yalov's search term, and the other with desc:yalov's search term.

Of course then people would want to save these more complex searches...

@ddanf
Copy link

ddanf commented Mar 5, 2021 via email

@HebaruSan
Copy link
Member

so if you can point me to the code, I could take a look and see if that informs my lunacy. ;)

The business logic is mostly here:

And the UI is mostly here:

(The two controls are basically two different views on that same search class.)

@ddanf
Copy link

ddanf commented Mar 5, 2021

I like where you're thinking... I might suggest a 'clear all filters' button

@HebaruSan
Copy link
Member

This might not be too bad. That previous screenshot was a mock-up from GIMP, this one is live running code:

image

Just tons and tons of clean-up and polishing left to go.

@HebaruSan
Copy link
Member

We can even do something about #3301 in the process, since moving the grid up and down will make a static location for that checkbox unviable...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New features or functionality GUI Issues affecting the interactive GUI
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants