Last filter replacing nothing with nothing is strange

Created on 12 July 2023, over 1 year ago
Updated 22 August 2023, over 1 year ago

Problem/Motivation

Directly after installation, without changing or saving anything, the last filter looks like this, which is a bit confusing.
Furthermore, we should be sure that this one is never executed for performance reasons? (check for empty on search

Thank you for this great module. I thought it would make sense to point this out.

Steps to reproduce

  1. Install the module
  2. visit admin/config/content/formats/manage/full_html or any other input format.

Proposed resolution

  • Never execute filters where search is empty
  • Remove the last line
  • Add a test for this setting and the empty exclusion?

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Fixed

Version

1.0

Component

User interface

Created by

πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @Anybody
  • πŸ‡¨πŸ‡¦Canada star-szr

    Hi, first of all thanks for writing this up! I really appreciate you taking the time to do this.

    The UI of this module was loosely inspired by https://www.drupal.org/project/stringoverrides β†’ , however this pattern of always having an empty row to fill out probably shows up in other places too. I didn't study this to see if it's a "good" pattern or not, just trying to follow what I see and make a smooth user experience. After reviewing their interface again, I realize I may have missed one important bit of UI/UX polish, more on that below.

    With stringoverrides you always get an extra row at the bottom of the form to fill in new overrides, and that is the intention here too. However, the two modules do have some key differences in this aspect:

    1. We have the preset set of filters that you always start with when configuring this plugin on a new text format, whereas with stringoverrides you start with a blank slate (and one empty row). With our module if you remove all the pre-configured filters and save, you will also end up with one empty row.
    2. With stringoverrides the "Replacement" box is hidden until you enter some text in the "Original" box. This is the bit of polish that I think we are currently missing.

    I think we have some options, of course aside from doing nothing:

    A. Don't add the empty row when there are filters configured already. Users will need to click the "Add another filter" button to add more filters.
    B. Only show the "Replacement" box if there is text in the "Search expression" input box.

    We also could do both. After thinking about it, I definitely want to at least do B, but I'm still not sure about whether to do A. I think B also has the added benefit of making the process of deleting filters a little bit more discoverable.

    What do you think?

    For the record, the empty filter never gets saved into config, so therefore never gets executed on paste. We also have form validation that the search pattern must be filled out and automated tests (Nightwatch) to cover most of what I have described.

  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    Thank you very much @star-szr. From my perspective, definitely A.
    I wouldn't invest time in B, but I think it's also fine.

    The reason for A is, that there are already many good defaults and adding custom selectors won't happen in most cases. And if you need it, you'll want to click the button to explicitly add a new line. The empty row is just confusing, I think.

  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica
  • πŸ‡¨πŸ‡¦Canada star-szr

    Thanks for your thoughts @Anybody! Restructuring the issue relationships for now, unless/until we create an overarching UX β€œPlan” issue.

  • πŸ‡¨πŸ‡¦Canada star-szr

    I'm working on this.

    • star-szr β†’ committed 3bc9838c on 1.0.x
      fix: remove empty filter row when there are filters configured
      
      Fixes: #...
  • Status changed to Fixed over 1 year ago
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024