Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dawehner’s picture

Issue tags: +Novice

Add tag

damiankloip’s picture

Issue tags: +Needs usability review

Get the usability guys involved too, we might want more than just the button value change...

IshaDakota’s picture

Status: Active » Needs review
FileSize
800 bytes

Patch with renamed button label. No usability review considered.

sun’s picture

Thanks :)

If we added proper tests in the original issue, then I can only hope that #3 will fail ;)

Status: Needs review » Needs work

The last submitted patch, drupal--vbo-button-fix-1845840-3.patch, failed testing.

damiankloip’s picture

@sun, are you saying we didn't or you hope we did (without looking)? There are fails, so I guess that's good then? :)

sun’s picture

Yup, and additionally, the correct test failed. :)

I didn't look at the actual user interface myself yet — neither the "backend" configuration of the bulk form element, nor the frontend appearance/usage. Would be good to perform some testing there to verify whether this makes sense for an ordinary site admin and user.

dawehner’s picture

Status: Needs work » Needs review
FileSize
1.78 KB

Sure we have tests which click the button.

Just in general i'm wondering whether it makes sense to allow to rename the button, so similar to the way you can do it on exposed forms.

wuinfo - Bill Wu’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
25.58 KB
+++ b/core/modules/action/lib/Drupal/action/Plugin/views/field/BulkForm.phpundefined
@@ -83,8 +83,8 @@ public function views_form(&$form, &$form_state) {
-      // Replace the text with Update.
-    $form['actions']['submit']['#value'] = t('Update');
+      // Replace the text with Apply.
+    $form['actions']['submit']['#value'] = t('Apply');

after apply patch

It is working. Tested in Drupal8.x with latest code, some test nodes and a view.

sun’s picture

Status: Reviewed & tested by the community » Needs review

Is that "Actions bulk form" the default label of the view plugin?

I could imagine that most site admins will just make that label invisible, leaving the default label - which would be detrimental for visually impaired users using a screenreader.

So if that is the default label, would it make sense to rename it to "Bulk Update"?


Second, do we need that description below the select element? I think that can be happily removed.

I also wonder whether we shouldn't apply .container-inline to the Action select widget container by default, so the Apply button appears next to it?

Lastly, anyone any ideas whether the "Action" label can be improved?

yoroy’s picture

For the label: "With selection"

wuinfo - Bill Wu’s picture

"Actions bulk form" is the default label of the view plugin.

wuinfo - Bill Wu’s picture

FileSize
2.49 KB
1.15 KB

I have changed the default label from "Actions bulk form" to "Bulk Update". Removed description below the select element.

Here is the patch and inter-diff between this patch and the patch at #8

sun’s picture

Thanks! :)

I guess the .container-inline part requires some more insight into views, since we'd only want to apply that to the first/upper select + button combo, but not to the second button at the end of the form — so probably a topic for @dawehner. :)

+++ b/core/modules/action/lib/Drupal/action/Plugin/views/field/BulkForm.php
@@ -77,14 +77,13 @@ public function views_form(&$form, &$form_state) {
       '#title' => t('Action'),

@yoroy additionally asked to rename this into "With selected" (or "With selection"? Not sure which of both is linguistically correct and works best in the interface)

sun’s picture

FileSize
49.41 KB

BTW, I'm not sure whether we actually need any kind of label for the select box.

We might want to change it to "With selection", but additionally set #title_display to 'invisible'.

Here's where I'm coming from:

vbo-ui-wordpress.png

Status: Needs review » Needs work

The last submitted patch, drupal-1845840-13.patch, failed testing.

yoroy’s picture

Status: Needs work » Needs review

Oh sorry, I meant to say 'With selection' yeah. I like how it explicitly links the actions to the selected items. 'Bulk actions' only implies that. And, 'With selection' allows itself to be "autocompleted by the actual actions:

With selection: promote to front page
With selection: unpublish

Bulk actions: promote to front page
Bulk actions: unpublish

The latter just doesn't flow as much as the first. Subtle, but I think there's a difference in the amount of brain cycles needed to grasp what applies to what.

Not sure if we should leave out the label. It's worth investigating if we could do that in more places (or are already doing it)

IshaDakota’s picture

To me, while "With Selection" may be more elegant, "Bulk Actions" seems more straightforward (as a label, at least).

Another semantic point: The 'help' text in the action_views_data() is in the second person (you):

Add a form element that lets you apply actions to multiple items

Outside of one other ( Content: Author uid), it is the only field help text that is in the second person. Also, you don't need to apply actions to "multiple items" - you could apply to just one. Might it be better as:

Add a form element that applies actions to one or more items

Not sure if there is a prevailing norm, as there isn't really guidance on second or third person in the Interface Text Stye Guide

wuinfo - Bill Wu’s picture

Small change from #13. Since patch 13 failed in test, the inter-diff file is between #7 and this patch.

wuinfo - Bill Wu’s picture

FileSize
619 bytes
2.59 KB

This patch include addition change for @sun's comment at #15

BTW, I'm not sure whether we actually need any kind of label for the select box.

We might want to change it to "With selection", but additionally set #title_display to 'invisible'.

dawehner’s picture

Issue tags: +Needs screenshots

Adding a tag :)

wuinfo - Bill Wu’s picture

Issue tags: -Needs screenshots
FileSize
20.68 KB

Screenshot after apply patch #20
screen shoot

Status: Needs review » Needs work

The last submitted patch, drupal-1845840-20.patch, failed testing.

dawehner’s picture

Status: Needs work » Needs review
+++ b/core/modules/action/lib/Drupal/action/Plugin/views/field/BulkForm.phpundefined
@@ -75,16 +75,16 @@ public function views_form(&$form, &$form_state) {
+      '#title' => t('With selection'),
+      '#title_display' => 'invisible',

It's invisible so i think we should describe for that this is actually used.

wuinfo - Bill Wu’s picture

#20: drupal-1845840-20.patch queued for re-testing.

wuinfo - Bill Wu’s picture

@dawehner, what is a better way to describe it? Or just leave it empty.

+++ b/core/modules/action/lib/Drupal/action/Plugin/views/field/BulkForm.phpundefined
@@ -75,7 +75,8 @@ public function views_form(&$form, &$form_state) {
+      '#title' => '',
dawehner’s picture

What about 'Bulk Update'?

sun’s picture

Title: Tweak the UI/UX of the views bulk operations interface » Tweak the UI/UX and accessibility of the views bulk operations interface
Assigned: Unassigned » sun

Hold on, I'm working on this as we speak.

sun’s picture

Assigned: sun » Unassigned
FileSize
10.72 KB
6.46 KB

Attached patch implements everything. ;)

I additionally looked up what the regular tableselect Form API processing code is doing to ensure accessible checkboxes.

Proof:

action-vbo-ux.29.png

I also think I found an architectural/functional bug in the actions/VBO implementation, so I added @todos there, but those are obviously left for another issue.

sun’s picture

+++ b/core/modules/action/lib/Drupal/action/Plugin/views/field/BulkForm.php
@@ -73,22 +77,29 @@ public function views_form(&$form, &$form_state) {
+    // Build the bulk operations action widget for the header.
+    $form['header']['action'] = array(
...
+    $form['header']['action']['action'] = array(

Realized it might be better to use the plugin ID instead of 'action' as parent array key in the form header.

dawehner’s picture

Thanks for working on that!

+++ b/core/modules/action/lib/Drupal/action/Plugin/views/field/BulkForm.phpundefined
@@ -51,21 +51,25 @@ public function views_form(&$form, &$form_state) {
+        // We are not able to determine a main "title" for each row, so we can
+        // only output a generic label.

We could introduce a configuration option on the field, but i'm not sure this is worth to do and wouldn't confuse the site builder a lot (because most will never see it).

+++ b/core/modules/action/lib/Drupal/action/Plugin/views/field/BulkForm.phpundefined
@@ -73,22 +77,29 @@ public function views_form(&$form, &$form_state) {
+      '#title' => t('With selection'),
+      '#title_display' => 'invisible',

Still not sure whether this is actually helpful for people.

+++ b/core/modules/action/lib/Drupal/action/Plugin/views/field/BulkForm.phpundefined
@@ -104,6 +115,8 @@ public function views_form_submit(&$form, &$form_state) {
+        // @todo This must not be based on row index, unless the entire view
+        //   results as well as the form are cached and not re-executed on POST.

You could maybe explain it, who you most not be based on row index. I guess you would need some kind of hash as value on the row, and determine that on the $result as well?

+++ b/core/modules/action/lib/Drupal/action/Plugin/views/field/BulkForm.phpundefined
@@ -113,7 +126,10 @@ public function views_form_submit(&$form, &$form_state) {
+          '@count' => $count,

No need for @count in format_plural

Status: Needs review » Needs work

The last submitted patch, drupal8.action-vbo-ux.30.patch, failed testing.

sun’s picture

1) Yeah, I don't think that an extra configuration option is necessary there.

2) Definitely helpful for screen-readers to make sense of the select options. Also allows people to unset/undo the #title_display property and actually show the label in their themes.

3) The problem I see is that the bulk operations are performed based on row indexes instead of entity IDs — This means that you can run into race conditions very very easily; i.e., 1) You access the view page, 2) While you're selecting items... 3) The site is actively under use, so items may be updated and new items may be created, but 4) The bulk operations are based on views result row indexes, and thus 5) The items [rows] you selected can mean entirely different things when the form is submitted. I probably shouldn't have added the @todo comments here, but should have created a separate issue instead.

4) Oops, yeah. ;)

dawehner’s picture

2) Definitely helpful for screen-readers to make sense of the select options. Also allows people to unset/undo the #title_display property and actually show the label in their themes.

Sure absolutly, i'm wondering about the actual string. What about "With action" or something more direct.

Regarding the usage of row index: it's no problem to fix this in another issue.

yoroy’s picture

Kinda surprising to see a move towards no visible label at all. What makes this so obvious to everybody that we don't need to show one? I still think 'With selection' is the best option :) Not because of elegance but because it helps people connect the dots, linking the operations to the checkboxes.

dawehner’s picture

Adding a tag, i don't think "with selection" is an accessible label.

sun’s picture

Status: Needs work » Needs review
FileSize
6.16 KB

Exposing the select label inherently means that .container-inline cannot be used.

But OK, I've removed #title_display and also .container-inline, and instead, we can leave that to themes, and I've added a comment to explain why the bulk form widget is wrapped in a separate container.

I think this is ready.

Bojhan’s picture

Issue tags: -Needs usability review
Bojhan’s picture

be gone

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

This indeed is a huge improvement.

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.x, thanks!

mgifford’s picture

@dawehner I'm trying to understand your concern with '#title' => t('With selection'), - is it just that it isn't clear in context?

dawehner’s picture

#42
It doesn't seem to be obvious for me that "with selection" gives you enough context to understand that this is an action you want to select.

Automatically closed -- issue fixed for 2 weeks with no activity.