Add visual indication on removed field (or filter) in Views UI

Created on 19 December 2012, almost 12 years ago
Updated 31 July 2023, over 1 year ago

Hello,

I've encountered a UX issue in the views rearrange dialog that I'd like to discuss and offer a solution too.

Where:

The field/sort/anything rearrange dialog

The problem:

  1. When you click on remove, the item is "removed from view", there is no clear indication of what was removed.
  2. I find it confusing regarding when the removal is actually done, when you click remove or after you click apply, and to what display it is applied.
  3. No option to undo the removal.

The solution

  1. Similar to what happens when you rearrange a field, a removed field should be highlighted in yellow
  2. In order to differentiate from a rearrange action, I propose the opacity of the title should be reduced
  3. Replace the remove link with an undo link.

I think these small changes will make the dialog much clearer, and provide a better user experience.

Thoughts?

Feature request
Status

Needs work

Version

11.0 🔥

Component
Views UI 

Last updated 11 days ago

Created by

🇮🇱Israel arbel

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇳🇱Netherlands tinto Amsterdam

    Sorry to dig up this very old feature request, but this issue came up when discussing another Views UI issue during Drupal Developer Days 2023 in Vienna. And I (still) agree with the OP in that this would be a very nice enhancement of the Views UI.

    1. Similar to what happens when you rearrange a field, a removed field should be highlighted in yellow

    I'm not sure if I'm a huge fan of this. I would opt for a bit more distinction between rearranged and deleted items.

    Taking a queue from Claro in the blocks layout screen, when you disable a block, a class is applied that subtly changes the row's background color and decreases the opacity:

    .block-disabled:not(:hover) {
        opacity: 0.675;
        background: #fcfcfa;
    }
    


    This seems to do the trick visually already.

    I'm wondering how to implement this though. Perhaps Views UI could provide a marked-for-removal class, but it would be up to the (admin) themes to attach the styling rules. So it sounds like this feature could need some coordination between views ui and theme maintainers.

  • 🇳🇱Netherlands tinto Amsterdam

    Applying Claro's styling from disabled blocks to Views UI would look like this:

  • 🇳🇱Netherlands Lendude Amsterdam

    I like this idea, the change in #14 feel a little too subtle though. Maybe add a strikethrough? Don't know, UX is not my thing, but +1 from me

  • 🇳🇱Netherlands tinto Amsterdam

    Here's a first attempt at a patch. Probably won't pass the tests, but it seems to work fine (with Stark enabled as backend theme).

    Claro doesn't load views_ui.admin.css so styling will not be visible there. We probably need a follow-up issue there to achieve what is depicted in #14.

  • Open in Jenkins → Open on Drupal.org →
    Environment: PHP 8.1 & MySQL 5.7
    last update over 1 year ago
    Custom Commands Failed
  • 🇳🇱Netherlands tinto Amsterdam

    Some JS refactoring

  • Open in Jenkins → Open on Drupal.org →
    Environment: PHP 8.1 & MySQL 5.7
    last update over 1 year ago
    Custom Commands Failed
  • 🇳🇱Netherlands tinto Amsterdam

    Fix for mistake in css comment in #17

  • Open in Jenkins → Open on Drupal.org →
    Environment: PHP 8.1 & MySQL 5.7
    last update over 1 year ago
    29,875 pass, 2 fail
  • Open in Jenkins → Open on Drupal.org →
    Environment: PHP 8.1 & MySQL 5.7
    last update over 1 year ago
    29,875 pass, 2 fail
  • Status changed to Needs work over 1 year ago
  • 🇳🇱Netherlands tinto Amsterdam

    Tests fail, because in the filter rearrange dialog screen, a removed filter now no longer completely disappears, but instead it is (visually) marked for removal. Hence, JS tests checking the last or penultimate row no longer give the same results and should be altered.

    Also, the changes in CSS do not apply to the filter rearrange dialog rows, as it has its own css class.

  • 🇳🇱Netherlands tinto Amsterdam
    • Altering the CSS somewhat so that it also applies to the Views UI rearrange filters dialog
    • Removing the last 2 steps of testOperatorLabels() in FilterCriteriaTest.php, because they expected the last row to disappear, which is no longer the case.
  • Open in Jenkins → Open on Drupal.org →
    Environment: PHP 8.1 & MySQL 5.7
    last update over 1 year ago
    29,884 pass, 2 fail
  • Status changed to Needs review over 1 year ago
  • last update over 1 year ago
    29,908 pass
  • 🇳🇱Netherlands tinto Amsterdam

    Fixing for a new test that snuck in while I wasn't paying attention:

    1) Drupal\Tests\views_ui\FunctionalJavascript\FieldDialogsTest::testRemoveFieldHandler
    Failed asserting that true is false.
    

    Test expects the Remove link to disappear after clicking it, which is no longer true.

  • Status changed to Needs work over 1 year ago
  • 🇺🇸United States smustgrave

    Can verify it now says "undo", maybe should be "Undo removal"

    Also the css opacity doesn't seem to take affect

  • 🇳🇱Netherlands tinto Amsterdam

    Thanks for the quick review @smustgrave!

    Can verify it now says "undo", maybe should be "Undo removal"

    I briefly discussed this with @lendude and @laurii during DrupalDevDays last week. Possible candidates were: "Undo", "Undo remove", "Restore", "Cancel", "Undelete" or possible even remove the link altogether, forcing users to cancel the form to undo their changes. We agreed that "Undo" was the best option for now, as it was short and concise, with the assumption that "users would understand". But this is definitely up for debate afaik.

    Also the css opacity doesn't seem to take affect

    The opacity change is part of views_ui.admin.css (part of the core views_ui module), but Claro does not load it and instead applies its own specific styling for Views UI. So I reckoned that the changes for Claro warrant a separate follow-up issue once the work in this one passes all the quality checks.

    For now, the changes in #21 are best tested with Stark enabled as backend theme. I will add this info the IS.

Production build 0.71.5 2024