Gerren / Playnite-FilterMaster

2 stars 0 forks source link

[Feature request] Logical 'OR' filter #6

Closed Kookiness closed 5 months ago

Kookiness commented 5 months ago

Hi! Excellent addon. :)

I'm thinking it could be useful to be able to do searches using 'OR' logic, for example 'Tag1 OR Tag2', or 'Feature1 OR Feature2'. It seems all searches currently use 'AND' logic, and I feel both types of logic have their use cases. However, please correct me if this is already possible to do, and I've just missed it!

I realise that excluding (setting to red colour) all tags EXCEPT the ones I want would accomplish an 'OR' search, but I think I have like... 750 different tags across my library, which would be a lot of clicks.

Examples of use cases:

Maybe this feature would be a bit complex to decide how to implement, but I thought it worth suggesting.

Thank you for reading!

Gerren commented 5 months ago

Hi there!

well, this sound definitely as a challenge.

Anyway, I've got an idea, how this might be achieved without much of a hustle...

There would be a possibility to introduce new state of a value (indicated by color), let's say purple.

In a single section (eg. Features), you could set any number of purple, and the condition would be evaluated as follows:

In your example, let's say Installed would be green, Metroidvania and Dungeon Crawler would be both purple, and let's say Sci-fi would be red.

This would have a single, quite big mind you, disadvantage. You couldn't in one section define two groups with OR conditions.

However, there would be possibility to define more than one such state - configurable even. Eg purple, then yellow, then cyan... In every such group, at least one of the values would have to be met...

Does something like this sound reasonable to you?

Were it not configurable, would one such state be enough? Or how many in your opinion?

I'm always open for new suggestions, so no worries ;)

Gerren commented 5 months ago

Implemented in 1.05 using 5 bracket colors. Have a look ;)

Kookiness commented 5 months ago

Apologies for the delay; I was thinking carefully about the details of my response so I didn't suggest implementing something unnecessarily, but it seems like you've already gone ahead and done it. Whoa, that was fast! I see the five 'OR' groups. :) I think that's more than enough. I've kept my original reply below that I was working on, in case you'd like my thoughts.

Oh, what a wonderful response! It's very refreshing to see a developer responding with such engagement to a suggestion, and in-depth consideration. :) Thank you, deeply appreciated!

The logic in the example you gave sounds good to me.

I see your point about deciding how many 'OR' groups should be configurable.

I suppose, with the interface using colours, it's a bit challenging to allow for multiple 'OR' groups, unless you allow for a large range of colours, but that could get confusing quickly.

An alternative would be something similar to what I've seen in other programs/systems, where you just, maybe click a '+' to add an extra row/rule, and are able to nest logic rules within each other, so you can essentially make the logic as complicated as you like--but I expect this would probably be overkill for most users with this addon, and would require redesigning the whole interface for applying the logic!

To answer your question about how many groups would be sufficient... I don't imagine I would need to use many, but it does seem a bit concerning to impose a limit that might easily be reached under normal usage.

I don't think I'd use the 'OR' groups all the time; maybe 1-3 from across different groups sometimes. Let's see... I think at the VERY most I would ever possibly expect to use, it would probably be one 'OR' group from each of the following: Feature, Genre, Tag, Category, and Completion Status. So that's just 1 within each group, but I think it would be extremely unlikely that I would even actually do that.

I suppose the section that has the most likely use for multiple 'OR' groups might be the "Feature" section; I don't think I would generally want to use more than one 'OR' in the other sections. It also seems that the number of 'OR' groups can be minimised if we trust that games are accurately tagged with an overarching Feature tag encompassing different sub-features; e.g. "VR" for all VR features; "Remote Play Together" for all Remote Play features, and so on. However, if a game isn't tagged in this way, that's when it might be an issue.

I'll try to come up with a plausible but extreme example I could theoretically imagine being useful, not that I would be likely to use one this complicated:

VR OR VR supported (in case any games only use one of those tags) AND (Co-Op OR Cross-Platform Multiplayer OR Pvp OR MMO OR Multi-Player OR Online Co-Op OR Online PvP OR PvP) AND (Remote Play On Phone OR Remote Play On Tablet OR Remote Play ON TV) AND (Full Controller Support OR Partial Controller Support OR Native Controller Support)

I suppose it's possible there might be other people could want more 'OR' groups.

Anyway, thank you so much for implementing this! My next thought, since this feature is implemented now, is that it now takes quite a few clicks to get through all the colours. Since 'OR' logic probably isn't needed often, this could cause minor inconvenience when not needing that logic. Not sure how I would suggest addressing this though. I'm also thinking that yellow and green (and maybe the darker colours) look a bit similar, at a glance. But those are minor quibbles; I'm shocked you implemented this so quickly! :)

Gerren commented 5 months ago

Hi there,

Pleasure to be of service 😄

You know, I like a good challenge, but you do not expect complete mathematical evaluation including bracket and infinite nesting, do you?

Let's keep it real, you do not need more than five OR brackets per sections. And I guess you had a really hard time finding the example you gave 😃 And, the current implementation would, as a matter of fact, allow to make such a query.

As you said it, it is such a niche thing, nobody will use it necessarily, so green and red are first, then come the OR bracket colors. For a quick reset, you can use right click to revert to the grey "not set" state quickly.

The solution for too much clicks is easy - there could be a right click context menu with all possibilities. This would collide with the current behaviour (reset), but that would be ok. Yet another feature.

The colors - it is a quite a thing to find a set of color, and the more colors the lesser the difference. It is implemented as half transparent, so that brings even more headaches. But the reason is, that I use the default theme, but you could be using another, and it COULD probably work the same. But the exact tint would be different. Easy solution would be to let user define them in a settings. Yet another feature - that nobody wants. OR, I could get rid of three and two wouldn't bring any confusion anymore.

As a lazy developer, I won't implement anything that A) I will use personally or B) somebody else gives a very good argument to do it.

Kookiness commented 5 months ago

No, of course I don't expect infinite nesting and such! I certainly don't need more OR brackets to use; that would certainly be overkill. :) I was just pondering the possibilities, before actually it wouldn't be worthwhile.

Oh! The quick reset via right-click will be wonderfully helpful - I didn't know about that. Thank you! I think that makes my observation a non-issue. Trying to solve it with another feature might just overcomplicate and confuse things!

Right now I think the main thing I would say is just to ensure it's made clear to the user what the meaning of the different colours is. I see the Readme mentions the OR filter, but I remember that I had to experiment a bit when I first started, to be confident I understood the meaning of each colour (though it didn't take long), so I imagine it might not be obvious to new users how the new colours work.

Yes, colours could indeed clash with themes, but I can certainly manage with the colours you've provided. :)

A "lazy developer"? Getting newly-suggested features implemented within a few days?! I'd call you the opposite! And yes, that reasoning for deciding which features to implement sounds sensible to me. I'm happy to know that must mean you thought my suggestions were a useful idea, then!

Kookiness commented 5 months ago

Actually, just a quick thought, in case anyone may wish to select a bunch of 'OR' Tags: For convenience, perhaps the middle-click (or even shift+click if middle-click clashes with anything in Playnite, but it doesn't seem like it does) could be used to skip green and red colours, and just cycle through the 'OR' + dark grey colours?

Gerren commented 5 months ago

Well, I might think about it 😉 The modifier keys aren't that hard, but are not straightforward either...