Figure out when the "Clear filters" and "Recommended filters" toggles should be visible

Created on 28 January 2025, 3 months ago

Problem/Motivation

In the long, long quest to make the Svelte app maintainable, πŸ“Œ Remove all remaining instance-specific constants from the Svelte code Active removed the dynamic toggling of the "Clear filters" and "Recommended filters" links.

I think it was the right move, because they are questionable from a usability standpoint. How is a user supposed to know what conditions will make "Recommended filters" visible? Or "Clear filters"? There is no sense of that; to someone who doesn't know what makes a filter "recommended", these links will seem to appear and disappear more or less at random.

If we want these to visible dynamically, we should think through the interaction carefully and add strong test coverage to confirm that it works as we intend. There was no preexisting test coverage of the visibility behavior, so that leads me to believe that the user interaction has never actually been thought through.

πŸ› Bug report
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States phenaproxima Massachusetts

Live updates comments and jobs are added and updated live.
  • Usability

    Makes Drupal easier to use. Preferred over UX, D7UX, etc.

Sign in to follow issues

Comments & Activities

  • 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?

  • πŸ‡ΊπŸ‡Έ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 link

    It 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

  • πŸ‡ΊπŸ‡ΈUnited States leslieg
Production build 0.71.5 2024