backdrop / backdrop-issues

Issue tracker for Backdrop core.
144 stars 40 forks source link

[UX] Views: Table format: Improve the description of the "Row class" field #3695

Open klonos opened 5 years ago

klonos commented 5 years ago

The description of the "Row class" field in the table format settings dialog reads as follows:

The class to provide on each row. You may use field tokens from as per the "Replacement patterns" used in "Rewrite the output of this field" for all fields.

Screen Shot 2019-04-22 at 5 28 34 am

Problems

  1. Either the "from" bit or the "as per" bit needs to be removed.

  2. It is not clear if the field supports adding one or multiple classes to each row (I personally think that there is no reason to not be supporting multiple), or if these are to be separated by spaces or commas.

    If multiple classes are supported, then the field label should be changed to "Row classes" instead (plural). The help text will also need to be updated to say "The classes to be added to each row..." (plural: classes), and the usual "separate by comma or space" text added as well.

    If only one class is to be supported, then we are missing form validation here, because I tried adding abc 123, and the form was saved; and so was the view afterwards. I then also tried using a mix of commas and spaces by changing the value of the field to abc, 123 zyx, and that was saved also. I have confirmed that the classes are being added properly to the table rows in both cases (with 123 converted to _23 as expected).

  3. Here, we are assuming that the user knows which replacement patterns are available, or we are forcing them to close this dialog, then edit one of the fields to see which tokens are available, then close that dialog, then finally (re)edit the table format, to come back and finish the task that they originally started to do. This is very poor UX.

    Usually, when a field supports tokens, we simply say that it does so, and we linkify the "tokens" word to pop up a token browser. Using the token browser, the user can drill down to supported tokens and click to add them to the field. I realize that because this is a dialog already, we may not be able to support this as a pop up, but we should at the very least be able to provide a fieldset, same as we do with the "Rewrite the output of this field" setting:

    Screen Shot 2019-04-22 at 5 36 29 am
  4. Related to point 3 above: the user needs to either be a Drupal/Backdrop user with lots of Views experience, or plain lucky to click on the last field to see available tokens. This is because of the weirdness that replacement patterns are, and their requirement to "properly" order fields: #3696

bugfolder commented 3 years ago

WRT your problem #2: in D7, this field supports space-delimited multiple classes (so I agree that it should be titled "Row classes"). But the functionality is broken; see https://github.com/backdrop/backdrop-issues/issues/5116.