Page MenuHome

Fix T83747: Search for add-ons does not include category
AbandonedPublic

Authored by Vincent Blankfield (vvv) on Dec 14 2020, 2:06 PM.

Details

Summary

The search in Preferences -> Add-ons didn't include the add-on category, which lead to some confusion (see T83747).

This patch adds add-on category and description to the searchable properties. T83747 said nothing about the description, but in my opinion it is useful too.

Diff Detail

Repository
rB Blender

Event Timeline

Campbell Barton (campbellbarton) requested changes to this revision.Dec 15 2020, 5:44 AM

The category should only be searched when "All" categories are on display. For single categories this doesn't make much sense.

This revision now requires changes to proceed.Dec 15 2020, 5:44 AM

Exclude category from the search when category filter is not set to "All"

To me it appears natural if the search of "import" among the "import" addons returns all of them. Makes no sense for the user to do so, but it's imho an intuitive behaviour of filtering and searching on the same term.

On the other hand, if category is excluded from the search when a category filter is active, the behaviour of the search may be a bit inconsistent. For example, when searching for "import" with category filter - "All", it will find "3D-Coat Applink" and other import addons that don't have "import" in their names and descriptions. When performing the same search with category filter set to "Import-Export", those addons will not be displayed.

In any case this is a minor difference and is imho acceptable both ways. So changing the patch as requested.

Campbell Barton (campbellbarton) requested changes to this revision.Dec 15 2020, 9:35 AM

Mostly fine, although I find the logic for these checks confusing.

if search and not ((search in ...) or (search in ...) or (search in ...)):
   continue

would reach much better.

Also, prefer not include description. We can easily add as part of separate patch.

This revision now requires changes to proceed.Dec 15 2020, 9:35 AM
release/scripts/startup/bl_ui/space_userpref.py
1854

filter != "All" should be ordered first. Currently it's always searching the category even when this is disabled.

Vincent Blankfield (vvv) edited the summary of this revision. (Show Details)

Symplified logical expression.
Removed description from the search.
Moved info["author"] and filter == "All" checks before the lookup in the author and category strings.

Vincent Blankfield (vvv) marked an inline comment as done.Dec 15 2020, 10:35 AM