Over on #2056089: UI problems on the Modules/Extend page we are working on fixing up the UI for filtering on the Modules/Extend page (as well as other UI issues on that page).

The conclusion we came to on comment #80 on that issue also applies to the Views list page (see comment #75 on that issue.

This pertains to the Search/Filter page on admin/structure/views. What we need to do there is:
a) Remove the description on the filter field.
b) Remove the field label (visually hide it)
c) Add placeholder text saying "Filter by view name or description" or "Filter by view name/description"

The patch on #81 on the other issue can probably be used as a guide, although it does a lot more to the modules page than just these changes.

This is probably a good Novice project?

Screenshots:

Before:

After:

Beta phase evaluation

Reference: https://www.drupal.org/core/beta-changes
Unfrozen changes Unfrozen because it only changes translatable strings.
Prioritized changes The main goal of this issue is user experience and accessibility
Disruption Disruptive for core because there's no consistence UI for this
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

moymilo’s picture

Status: Active » Needs review
FileSize
989 bytes

Add this fixe's:
a) Remove the description on the filter field.
b) Remove the field label (visually hide it)
c) Add placeholder text saying "Filter by view name"

Status: Needs review » Needs work

The last submitted patch, 1: views_ui-module-2380117-1.patch, failed testing.

moymilo’s picture

Status: Needs work » Needs review
FileSize
741 bytes

Status: Needs review » Needs work

The last submitted patch, 3: views_ui-module-2380117-1.patch, failed testing.

moymilo’s picture

Status: Needs work » Needs review
FileSize
749 bytes
jhodgdon’s picture

Status: Needs review » Needs work

Ah, my mistake.

It seems that the filter on the Views page goes by both the view name and the view description.

This is the same problem we're running into on #2056089: UI problems on the Modules/Extend page in the latest comments (#82, 84, 85). I'm not sure how we should resolve it, but the placeholder text is not accurate.

Also, one other change here: the visually-hidden "Search" label on the filter field should be changed to "Filter".

er.pushpinderrana’s picture

Status: Needs work » Needs review
FileSize
584 bytes
738 bytes

As per https://www.drupal.org/node/2056089#comment-9372491, made changes, please review once.

dawehner’s picture

Let's add some screenshot to see what is going on before and after.

Having some accessibility review would be also great here.

jhodgdon’s picture

Yeah we should verify that the fact that the list has been filtered is announced in the same way it is now on the Extend page.

jhodgdon’s picture

Status: Needs review » Needs work

As on the other issue, this filters by both the view name and description. So I think we need to change the placeholder text to "Filter by name/description".

The last submitted patch, 7: views_ui-module-2380117-7.patch, failed testing.

hussainweb’s picture

Status: Needs work » Needs review
FileSize
650 bytes
753 bytes

Changing as per #10.

jhodgdon’s picture

Thanks! This is probably fine, although I think we could use shorter placeholder "Filter by name/description" instead of "Filter by view name or description". Either way is probably fine, as long as the longer text fits in the box.

So, what we need here:
- Before and after screen shots
- Maybe we should test this with all available Core themes as the admin theme, to make sure the placeholder text fits in the box no matter what theme is used?
- Someone needs to do an accessibility test. We need to make sure that when filtering happens, screen readers are "announcing" that the list of views has changed.
- Before we'll be able to commit this patch, we'll need a "Beta phase evaluation" block added to the issue summary. See https://www.drupal.org/contribute/core/beta-changes for instructions.

lefeeza’s picture

I am making screenshots

tadityar’s picture

I've done an accessibility testing using Mac's VoiceOver. I don't hear any announcement when I type in the filter but it's also like that before the patch is attached.. so I think it's not the patch's fault.

Below is the screenshot

Before
Before

After
Only local images are allowed.

tadityar’s picture

FileSize
22.45 KB
tadityar’s picture

Issue summary: View changes

added beta evaluation and minor change, please correct me if I'm wrong.

jhodgdon’s picture

Status: Needs review » Needs work

Thanks for testing! If the "announce" isn't working, then that should be fixed in this issue.

manvendrakot’s picture

Status: Needs work » Needs review
Issue tags: +#SprintWeekend2015
FileSize
1.3 KB
1.3 KB

Css changes for the #12

monobasic’s picture

I don't think it's a good idea to solve the width problem on a specific css base here - the original elements width was defined through the size="30" attribute on the input, so maybe it would be better to tweak the size there.
Apart from that the introduced max-width is already applied from form.css styles.
In general - shouldn't this width issues discussed/solved one level higher and style all instances of the filters in the same way?

monobasic’s picture

YesCT’s picture

Issue tags: -#SprintWeekend2015 +SprintWeekend2015

Thank you for working on this issue.

We should all try and use the same sprint tag. According to https://groups.drupal.org/node/447258 it should be SprintWeekend2015 with no #.

idebr’s picture

Status: Needs review » Needs work

Looks great!

+++ b/core/modules/views_ui/src/ViewListBuilder.php
@@ -186,9 +186,10 @@ public function render() {
diff --git a/sites/default/default.services.yml b/sites/default/default.services.yml

diff --git a/sites/default/default.services.yml b/sites/default/default.services.yml
old mode 100644
new mode 100755
diff --git a/sites/default/default.settings.php b/sites/default/default.settings.php

diff --git a/sites/default/default.settings.php b/sites/default/default.settings.php
old mode 100644
new mode 100755

I don't think these changes should be in this patch?

monobasic’s picture

vaibhavjain’s picture

Status: Needs work » Reviewed & tested by the community

Patch looks good now.

idebr’s picture

Status: Reviewed & tested by the community » Needs work

#23 has not yet been addressed.

tadityar’s picture

Status: Needs work » Needs review
FileSize
752 bytes

deleted the change

Status: Needs review » Needs work

The last submitted patch, 27: ui-filter-views-list-2380117-27.patch, failed testing.

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 27: ui-filter-views-list-2380117-27.patch, failed testing.

joscartesar’s picture

Assigned: Unassigned » joscartesar
Issue tags: +Needs reroll

#SprintWeekend2015
I realise that the patch doesn't apply. I'm going to reroll it

joscartesar’s picture

Assigned: joscartesar » Unassigned
Status: Needs work » Needs review
FileSize
775 bytes

My first contribution/patch!
#SprintWeekend2015
Reroll done

penyaskito’s picture

Status: Needs review » Needs work
Issue tags: -Needs reroll +Needs screenshots

Thanks everyone working on this!

Removed the Needs reroll tag.
Also added Needs screenshots tag. We should update the issue summary with screenshots *before* the patch and *after* the patch.
See tips for adding screenshots.

markfelton’s picture

Assigned: Unassigned » markfelton

Reviewing this now for #SprintWeekend2015

joscartesar’s picture

Issue tags: -Needs screenshots
FileSize
9.12 KB
9.14 KB

markfelton’s picture

Status: Needs work » Needs review
FileSize
174.57 KB

Screenshot showing placeholder text, still needs accessibility review

penyaskito’s picture

Issue summary: View changes

Updated IS with screenshots.

monobasic’s picture

Good idea with the screenshots, Patch: 2380117-32-reroll.patch works fine here..

penyaskito’s picture

Issue tags: +Needs tests

@monobasic Thanks for testing it!

I guess this needs automatic testing now, then?

monobasic’s picture

Never did one, but I am happy to try! Maybe you could give me some startup advice: What would be senseful to test in this case? Test for the proper markup and the text of the placeholder? And would be the test for views list case only?

markfelton’s picture

Assigned: markfelton » Unassigned
illeace’s picture

I also tested the patch and it worked for me and does all three things listed in the original write-up.

penyaskito’s picture

Status: Needs review » Needs work

@monobasic Thanks for volunteering!

What I would do is creating a ViewsListFormWebTest test class in the namespace Drupal\views_ui\Tests.

If you look at \Drupal\system\Tests\Form\ModulesListFormWebTest as an example you have a test that checks for some HTML in the modules administration page.

You should do something similar, but asserting that the filter textbox has the right size and texts. Just ensure that the views_ui module is enabled (see the $modules array) and that you are accessing with a user with the right permissions (see the drupalCreateUser call).

If you have any doubts don't hesitate to ask for help here or on IRC.

monobasic’s picture

Assigned: Unassigned » monobasic

cheers, looking into that...

dawehner’s picture

Issue summary: View changes

Commented in the beta evaluation :) Thanks for writing it.

monobasic’s picture

Status: Needs work » Needs review
FileSize
2.33 KB

I've added the test, please review!
Not sure if I get the xpath part right - it seems to me that the input filter field should be targeted specifically, the way it is right now, the assertions just checking for a field containing the attr and value, is that correct? Thanks guys!

penyaskito’s picture

Status: Needs review » Needs work
Issue tags: -Needs tests

@monobasic: Congratulations for your first test, thanks for contributing!

IMHO given xpath it is enough. If you can improve it with a more specific xpath query would be perfect, but not a requirement.
Some minor nitpicks:

  1. +++ b/core/modules/views_ui/src/Tests/ViewsListFormWebTest.php
    @@ -0,0 +1,49 @@
    +  public static $modules = array('system_test', 'views_ui');
    ...
    +    \Drupal::state()->set('system_test.module_hidden', FALSE);
    

    system.test is not used, let's remove it from here. Then we can remove setUp() completely.

  2. +++ b/core/modules/views_ui/src/Tests/ViewsListFormWebTest.php
    @@ -0,0 +1,49 @@
    +    $this->assertFieldByXPath("//input[contains(@title, 'Enter a part of the view name or description to filter by.')]");
    +    $this->assertFieldByXPath("//input[contains(@placeholder, 'Filter by view name or description')]");
    

    Those should have t() or they will fail if running tests in a translated version. t() is only used in testing when the strings inside it are part of the UI, but we still need it there.

Just a note: when rolling a patch for a bug with a test, it is really useful to upload two patches, one with only the test and one with the test and the fix. So the first one will fail, ensuring that we are fixing the right thing. See https://www.drupal.org/contributor-tasks/write-tests for concrete instructions.

Thanks again!

monobasic’s picture

@penyaskito: Many thanks for your help, much appreciated :) I will include your suggestions and upload two separate patches..

monobasic’s picture

Status: Needs work » Needs review
FileSize
1.43 KB
2.19 KB

done and added new patches - please review, thanks!

The last submitted patch, 49: 2380117-49-test.patch, failed testing.

penyaskito’s picture

Status: Needs review » Reviewed & tested by the community

Perfect, thanks!!

I would mark this as RTBC, but we still need an accessibility review. I would try to get someone from the team here.

penyaskito’s picture

Status: Reviewed & tested by the community » Needs review

"I would" means that I shouldn't have changed status.

opdavies’s picture

I can take a look at it from an accessibility perspective. I'm travelling home at the moment, but I'll take a look and update with another comment ASAP.

dawehner’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +VDC

Nice!

alexpott’s picture

Status: Reviewed & tested by the community » Needs work

The change looks good but...

+++ b/core/modules/views_ui/src/Tests/ViewsListFormWebTest.php
@@ -0,0 +1,41 @@
+    // Ensure expected markup and values for the search/filter inut field
+    $this->assertFieldByXPath('//input[contains(@class, "views-filter-text")]');
+    $this->assertFieldByXPath('//input[contains(@size, "40")]');
+    $this->assertFieldByXPath('//input[contains(@type, "search")]');
+    $this->assertFieldByXPath('//input[contains(@title, "' . t('Enter a part of the view name or description to filter by.') . '")]');
+    $this->assertFieldByXPath('//input[contains(@placeholder, "' . t('Filter by view name or description') . '")]');

Here we are just testing features of the form API. I think this test is not really testing anything. And therefore shouldn't exist.

monobasic’s picture

Assigned: monobasic » Unassigned

Thanks for the review. The test was mentored and approved by @penyaskito, so I don't really know what to do here -> status back to unassigned

dawehner’s picture

I have to agree with @alexpott, ... we don't have any logic which has to be tested here. Adding the test coverage would just make it more complex to change the labels etc. later, if wanted.

penyaskito’s picture

OK, so what's next? Using #32? I guessed that having that test would be better than nothing.

tadityar’s picture

Status: Needs work » Needs review
FileSize
775 bytes

This is the complete patch in #49 with suggested removal of some assertions in #55.

penyaskito’s picture

Status: Needs review » Reviewed & tested by the community

RTBC per #54 and #57.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

UI text is not yet frozen. Committed 7b64a0a and pushed to 8.0.x. Thanks!

  • alexpott committed 7b64a0a on 8.0.x
    Issue #2380117 by monobasic, tadityar, moymilo, hussainweb, manvendrakot...

Status: Fixed » Closed (fixed)

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