Skip to content

Global search setting filters to broadly #497

@IsakNaslundBh

Description

@IsakNaslundBh

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:

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.

Metadata

Metadata

Assignees

Labels

type:bugError or unexpected behaviour

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions