- 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,
- πΊπΈUnited States dlfaison
I am a first time user of this module testing at ALT2025 DrupalCon General contributor session.
Personally, I would prefer to list all of the modules by default (nothing selected) with the Recommended filters link available. Initially when I clicked on Recommended Filters but nothing appears to happens (since it was already set by default). I wasn't sure if the link was broken, but it wasn't after someone explained the purpose of the link.
If the Recommended filters link is clicked, the first two checkboxes (Only show projects covered by a security policy, Only show actively maintained projects) are checked and the Clear filters link should appear.
The Clear filter link should only appear (assuming the Recommended filter isn't checked by default):
- after a search has been performed
- the user makes selection in the Filter by category filter.
- Clicked the Recommended filters linkIt would be helpful if the Recommended filter would have tooltip to indicate that the link will display modules are actively maintained.
I would like to see the Clear Filters and Recommended filters be buttons and not links. It was easy to overlook them at first until I looked more closely when I needed to locate them.
If you are going to keep the default set to display the recommended filtered modules, it would be helpful to know the recommended modules were already selected by default disable the link until they clicked the clear filter link.
Better yet, only include a list with all the modules that meet your criteria of recommended filters so you would have no need for the Recommended filters link. If they wanted something unsupported then send them to Drupal.org.
- πΊπΈUnited States leslieg
Worked with Dawain on this during contribution day, Adding Atlanta2025 tag