Problem/Motivation

This is a follow up of #2981044: Unify the grid/table views of the media library. From comment 45.2:

The tabbing order of the view is messed up. The grid and table buttons come before the name filter in the DOM, but visually they come after the apply-filters button This will confound sighted keyboard users. Make the tabbing order match the visual reading order.

Having the tab order match the visual order is A-level WCAG criteria, but we cannot actually fix this until Media Library is stable and can therefore add an accessible template to Seven. This issue should fix the DOM order and be commited asap after the media library is marked stable.

Proposed resolution

Add a views template to Seven for the Media library to fix the DOM order.

Remaining tasks

Create a patch and have it ready to be committed when the media library is marked stable.

User interface changes

No visual changes, just the DOM order should change.

API changes

None.

Data model changes

None.

Release notes snippet

Comments

seanB created an issue. See original summary.

andrewmacpherson’s picture

Issue tags: -Accessibility +accessibility

What's the correct tag to mark this as a minor release blocker?

phenaproxima’s picture

Issue tags: +Triaged D8 critical

I'm not sure, but I'm marking this as a triaged critical per the discussion summarized in #2981044-64: Unify the grid/table views of the media library. Once this is unblocked, we should escalate its priority to critical.

seanb’s picture

StatusFileSize
new2.82 KB

Patch is attached to change to order of the views header and the exposed filters.

steinmb’s picture

Status: Postponed » Needs review
phenaproxima’s picture

Status: Needs review » Postponed

This is actually postponed on Media Library becoming stable, so it’s not quite time to open this back up yet. :)

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

mgifford’s picture

Issue tags: -accessibility (duplicate tag) +Accessibility

Fixing tagging.

xjm’s picture

I added this to the scope of #3082690: Mark Media Library as a stable core module. We might end up with this issue marked as a duplicate of that one as they should probably be fixed in the same patch (rather than as a followup) since it's a critical accessibility issue.

bnjmnm’s picture

StatusFileSize
new3.08 KB
new1.67 KB
new5.9 KB

Although this is technically postponed, this is work that can continue as it can't be committed until media library is stable in #3082690: Mark Media Library as a stable core module but the actual development does not depend on that issue.

This patch adds a test and addresses four @todo's that reference this issue.

wim leers’s picture

This looks ready :)

Is the needs accessibility review tag still applicable here?

seanb’s picture

Is the needs accessibility review tag still applicable here?

The solution had been discussed, but as far as I know the patch in this issue has not been shown to the A11Y team. So I think we should still do that and make sure the solution solves the concerns.

andrewmacpherson’s picture

I've been watching this issue sure enough; it was me who asked for this in one of the UX calls. The "needs accessibility review" tag was appropriate, because we knew this issue could be postponed for many months and the module code could have changed in the meantime.

The solution is correct, and straight-forward enough. Flexbox order is a huge problem when it's used to rearrange interactive elements (or containers with interactive elements). The relevant WCAG success criteria are 1.3.2 Meaningful Sequence (level A) and 2.4.3 Focus Order (level A).

I manually tested patch #11 today, and it's working as intended.

The test in #11 is a bit spurious:

+    // Assert that the media library view has the filter appearing before the
+    // header in the DOM. This is needed for accessibility.

That's not actually what we're interested in. By itself, the DOM order doesn't matter here. What matters is that the DOM order, the tabbing order, and the visual presentation order are in harmony. From Understanding 2.4.3 Focus Order:

when the order of a particular presentation differs from the programmatically determined reading order, users of one of these presentations may find it difficult to understand or operate the Web page. [...]

For example, a screen reader user interacts with the programmatically determined reading order, while a sighted keyboard user interacts with the visual presentation of the Web page. Care should be taken so that the focus order makes sense to both of these sets of users and does not appear to either of them to jump around randomly.

The test in #11 doesn't really protect that. Later changes could disrupt the tabbing order with tabindex attributes, or disrupt the visual focus order with flexbox order. Either of these would be bad for SC 2.4.3 Focus Order, but the test here would still pass. Unless we can get a test which looks at the the whole combination of DOM order, tabbing order, and visual order, then I don't think it's worth having a test at all.

wim leers’s picture

I manually tested patch #11 today, and it's working as intended.

Great! That means accessibility review is now completed, and this is only blocked on A) the module becoming stable, B) the test being improved based on #14. Consider this virtually marked Needs work :)

xjm’s picture

Status: Postponed » Needs work
Issue tags: +Needs tests

Cool -- let's update the tests on this now. @phenaproxima suggested keeping this issue rerolled once it's RTBCable, and ready for commit when we mark the module stable.

andrewmacpherson’s picture

Just to clarify #14 - I don't think this is possible to test.

bnjmnm’s picture

Status: Needs work » Needs review
Issue tags: -Needs tests
StatusFileSize
new1.67 KB
new4.23 KB

#17 Makes sense, here's the patch without a test.

wim leers’s picture

Title: Add a Media library views template to Seven theme to change to order of the views header and exposed filters » Add a Media Library views template to Seven theme to change to order of the views header and exposed filters
Status: Needs review » Postponed

So that means this is virtually RTBC, but it cannot be committed until the Media Library module is marked stable. Marking Postponed to avoid us continuing to look at this until that time.

wim leers’s picture

To clarify: this is blocked on #3082690: Mark Media Library as a stable core module becoming unblocked 🤓

phenaproxima’s picture

StatusFileSize
new1.28 KB

At @lauriii's request, posting a diff between Classy's views-view.html.twig and the variant we're adding to Seven in this patch.

lauriii’s picture

Thanks for the diff @phenaproxima!

+++ core/themes/seven/templates/views-view--media_library.html.twig	2019-10-07 12:05:18.000000000 -0400
@@ -32,12 +32,12 @@
-    'view',
-    'view-' ~ id|clean_class,
-    'view-id-' ~ id,
-    'view-display-id-' ~ display_id,
-    dom_id ? 'js-view-dom-id-' ~ dom_id,
-  ]
+  'view',
+  'view-' ~ id|clean_class,
+  'view-id-' ~ id,
+  'view-display-id-' ~ display_id,
+  dom_id ? 'js-view-dom-id-' ~ dom_id,
+]

This looks unrelated change. Let's revert this. Other than that, this looks great!

jeroent’s picture

StatusFileSize
new4.24 KB
new684 bytes

Made changes as suggested by @lauriii in #22.

phenaproxima’s picture

Thanks, @JeroenT!

@lauriii, @bnjmnm, and I reviewed this issue in Zoom today. Except for the indentation issue (now fixed), Lauri said this is committable. So consider that a "virtual" commit, blocked on making Media Library stable. 🎉

Beyond any needed rerolls, there is no need for any further work on this patch.

phenaproxima’s picture

Status: Postponed » Fixed

Marking this issue fixed, because it has been "virtually committed" by @lauriii and rolled into the big patch being built in #3082690: Mark Media Library as a stable core module. No further work should take place here; I'll transfer credit into the other issue.

Status: Fixed » Closed (fixed)

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