- Issue created by @phenaproxima
- πΊπΈUnited States phenaproxima Massachusetts
Let's be clear here on what "cleared" filters and "recommended" filters means.
To me, the difference is obvious:
- Cleared filters means all filters are set to a falsy value, such as an empty string for text filters,
false
for boolean filters, or an empty array for multiple-choice filters. - Recommended filters, on the other hand, are whatever the default filter values were that the source plugin starts you off with. In other words, the filter values returned by
ProjectBrowserSourceInterface::getFilterDefinitions()
.
So, when do we show "Clear filters"? When any of the filters has a truthy value.
And when do we show "Recommended filters"? Whenever any of the filters has been changed from its initial value.
Having said all of this, I'm not sure there is much to be gained by showing and hiding these actions dynamically. End users cannot be expected to understand or care about the intricacies of filtering and truthiness vs. falsiness. They will just see the "clear filters" and "recommended filters" actions appearing and disappearing at what will seem to them like random times.
So honestly? This probably already works as designed. We can keep it simple, always show those actions, and if the filters are already cleared or already recommended, clicking the actions simply does nothing.
Thoughts?
- Cleared filters means all filters are set to a falsy value, such as an empty string for text filters,