Negated search for name, desc, author, lang, relationships, tags#3460
Merged
Conversation
DasSkelett
reviewed
Apr 10, 2022
3930388 to
fd1fe49
Compare
DasSkelett
approved these changes
Apr 10, 2022
Member
DasSkelett
left a comment
There was a problem hiding this comment.
Noticed one unused import and two code doc parameters not matching their respective actual parameter names.
I like it!
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
The GUI search currently supports a limited disjunctive normal form in which only some terms can be negated (the ones using the tri-state toggle control). It would be nice to be able to negate the remaining ones.
Changes
Now if you add
-to the start of any of the following search terms (before the prefix), that term will be flipped so it matches only the mods that it didn't match previously:desc:prefix in English)@prefix)lang:prefix in English)dep:prefix in English)rec:prefix in English)sug:prefix in English)conf:prefix in English)tag:prefix in English)For example, while
@HebaruSanwould include my mods,-@HebaruSanwould exclude them. The prefixes are omitted from the expanded per-term search boxes, so if you expand the latter search, the authors field would contain-HebaruSan.The label search is not negatable because you can already configure a label to hide the mods it contains (and because it would be annoying technically to do it since unlike the other search terms we track it as a list of
ModuleLabelobjects with no place to store whether it's negated).Fixes #3397.