-
Notifications
You must be signed in to change notification settings - Fork 6
Description
Description:
Search filtering introduced in #482 was a great addition to help simplify the UI to make it only show methods and classes relevant to you. However, the filtering mechanism introduced here:
BHoM_UI/BHoM_UI/Global/GlobalSearch.cs
Lines 165 to 186 in a5e78cd
m_SearchMenu.PossibleItems = m_PossibleItems.Where(x => | |
{ | |
if (excludedToolkits.Any(y => x.Text.Contains(y))) | |
return false; | |
return true; //If the text does not contain any of the excluded toolkits then include it in this display | |
}).Select(x => | |
{ | |
SearchItem withWeight = x.ShallowClone() as SearchItem; | |
withWeight.Weight = withWeight.Weight(config); | |
return withWeight; | |
}).Where(x => x.Weight > 0).ToList(); | |
} | |
else | |
{ | |
m_SearchMenu.PossibleItems = m_PossibleItems.Where(x => | |
{ | |
if (excludedToolkits.Any(y => x.Text.Contains(y))) | |
return false; | |
return true; //If the text does not contain any of the excluded toolkits then include it in this display | |
}).ToList(); |
Is to broad, and can filter out things not expected to be missing. For example, filtering out "Environment" makes Most LifeCycleAssessment methods not show, given they contain classes that contain "Environment" in their name.
Steps to reproduce:
Untick "Environment" and try searching for LCA_Toolkit objects and methods.
Expected behaviour:
Would expect the filtering mechanisms to filter based on namespace rather than the word being any part of the name. Suggesting to change the current filtering mechanisms that is a "Contains" to instead exclude methods and classes which types begins with for example, BH.oM.Environment
and BH.Engine.Environment
rather that the current implementation with a "Contains"
Test file(s):
Not really applicable, tested with settings and search menu behaviour.