feat(filters): Add new tag filtering modes `AND`, `EXACT` & `NOT` (@TristanMarion)
Description
This PR implements issue #4239, which adds a new toggle feature to switch between OR, AND and EXACT logic modes for tag filtering in the account page :
OR: any selected tag must matchAND: all selected tags must matchEXACT: exactly the selected tags must match
ANDmodenone- Results without tags- tags - Results tags should include the selected tag/tags
noneand tag - Nothingall (or no tag)- Nothing
ORmodenone- Results without tags- tags - Result tags should include any of the selected tags
noneand tag - Result without tags plus result tags should include any of the selected tagsall (or no tag)- Everything
EXACTmodenone- Results without tags- tags - Results tags should exactly match the selected tags
noneand tag - Nothingall (or no tag)- Nothing
Checks
- [x] Check if any open issues are related to this PR; if so, be sure to tag them below.
- [x] Make sure the PR title follows the Conventional Commits standard. (https://www.conventionalcommits.org for more info)
- [x] Make sure to include your GitHub username prefixed with @ inside parentheses at the end of the PR title.
Closes #4239
Several checks in video :
Dataset used
We will mainly have tag 1, 2 and 3 for our tests, the list of test tags is : 1, 2, 3, 1,2, 1,3, 2,3, 1,2,3
https://github.com/user-attachments/assets/d4afb820-e2bc-4d9b-b447-0b2cf69679a3
OR mode with tag 1 : we only have 1, 1,2, 1,3 & 1,2,3
https://github.com/user-attachments/assets/f0502cc2-1205-482e-8687-0191c41dae9a
OR mode with tags 1 & 2 : we only have 1, 2, 1,2, 2,3, 1,3 & 1,2,3
https://github.com/user-attachments/assets/300b251d-c41a-4d12-b138-88c60f8c2e86
AND mode with tags 1 & 2 : we only have 1,2 & 1,2,3
https://github.com/user-attachments/assets/5b63ca2d-3433-4752-8d83-585d8081a9ad
EXACT mode with tags 1 & 2 : we only have 1,2
https://github.com/user-attachments/assets/8f65fa8c-c7f0-401e-bd4d-0f9e9875ad59
EXACT mode with tag 1 : we only have 1
https://github.com/user-attachments/assets/ab5781eb-9c0c-48ec-841f-51ab04475285
AND mode with tag 1 (same behavior as OR with tag 1) : we only have 1, 1,2, 1,3 & 1,2,3
https://github.com/user-attachments/assets/a2df3287-9470-4b0f-b754-89bebac736c1
Continuous integration check(s) failed. Please review the failing check's logs and make the necessary changes.
Nice! How about we also add an 'exact' mode, where result tags have to exactly match your selection?
Thanks for the feedbacks 😊 indeed this was intended to have a non exclusive AND (to match at least the tags selected but not all the tags) but if you think that it should be an exact match I can perform the change 👍 Let me know what you prefer and I’ll update it 👌
Thanks for the feedbacks 😊 indeed this was intended to have a non exclusive AND (to match at least the tags selected but not all the tags)
My bad, I see the use case now. However, I think an "exact" mode would be equally useful. This is just my free opinion as a user, it is up to miodec if he prefers 3 modes or 2.
Lets have 3 modes, or, non exclusive and and exclusive and (exact mode). Click the button to cycle through them.
Pretty clear, I’ll handle the changes to match the expected behaviour. Makes sense to have the three modes 👌
I've reorder the imports to reduce the number of line changed 👍 (and to keep the same import order as before too 😅 )