Skip to content

Negated search for name, desc, author, lang, relationships, tags#3460

Merged
HebaruSan merged 2 commits into
KSP-CKAN:masterfrom
HebaruSan:feature/gui-search-not
Apr 10, 2022
Merged

Negated search for name, desc, author, lang, relationships, tags#3460
HebaruSan merged 2 commits into
KSP-CKAN:masterfrom
HebaruSan:feature/gui-search-not

Conversation

@HebaruSan
Copy link
Copy Markdown
Member

@HebaruSan HebaruSan commented Oct 11, 2021

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:

  • Name (no prefix)
  • Description (desc: prefix in English)
  • Authors (@ prefix)
  • Localizations (lang: prefix in English)
  • Depends (dep: prefix in English)
  • Recommends (rec: prefix in English)
  • Suggests (sug: prefix in English)
  • Conflicts (conf: prefix in English)
  • Tag (tag: prefix in English)

For example, while @HebaruSan would include my mods, -@HebaruSan would 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 ModuleLabel objects with no place to store whether it's negated).

Fixes #3397.

@HebaruSan HebaruSan added Enhancement New features or functionality GUI Issues affecting the interactive GUI Pull request labels Oct 11, 2021
@HebaruSan HebaruSan requested a review from DasSkelett October 11, 2021 19:48
Comment thread GUI/Model/ModSearch.cs Outdated
@HebaruSan HebaruSan force-pushed the feature/gui-search-not branch from 3930388 to fd1fe49 Compare April 10, 2022 16:51
Copy link
Copy Markdown
Member

@DasSkelett DasSkelett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noticed one unused import and two code doc parameters not matching their respective actual parameter names.
I like it!

@HebaruSan HebaruSan merged commit 48c84fa into KSP-CKAN:master Apr 10, 2022
@HebaruSan HebaruSan deleted the feature/gui-search-not branch April 10, 2022 17:43
@HebaruSan HebaruSan mentioned this pull request Sep 19, 2024
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 this pull request may close these issues.

[Feature] Negative statements in search

2 participants