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

Optimize label searches and handle spaces in names #4270

Merged
merged 2 commits into from
Dec 3, 2024

Conversation

HebaruSan
Copy link
Member

@HebaruSan HebaruSan commented Dec 3, 2024

Problem

If you make a label with spaces in its name and apply it to some mods, filtering by that label finds no mods.

Reported by Discord user TEMPEST.

Cause

The search syntax uses spaces to separate parts of the search, so label:Name With Spaces is changed to label:NameWithSpaces, but the label checking logic wasn't accounting for this.

Changes

  • Now the label checking logic removes spaces from a label name before checking whether it matches the query
  • The repetitive parts of label searches (translating names to label objects, checking for negation) are now precalculated once, which should give such searches a tiny performance boost
  • Now the Filters → Labels menu shows the label colors like the right click menu does
    image

@HebaruSan HebaruSan added Bug Something is not working as intended Enhancement New features or functionality GUI Issues affecting the interactive GUI Performance Something's slower than it should be labels Dec 3, 2024
@HebaruSan HebaruSan merged commit c70b5cd into KSP-CKAN:master Dec 3, 2024
3 checks passed
@HebaruSan HebaruSan deleted the fix/label-search-spaces branch December 3, 2024 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is not working as intended Enhancement New features or functionality GUI Issues affecting the interactive GUI Performance Something's slower than it should be
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant