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

Created on 28 January 2025, about 1 month 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?

Production build 0.71.5 2024