Problem/Motivation

In #2962525-70: Create a field widget for the Media library module, this feedback was raised:

Last thing I noticed is we are not showing the media type in the library. This is probably a separate issue, but it could be hard to see the difference between a remote video and an image at first glance. They both show an image thumbnail. This might be an issue when users enable multiple types for a field (like for a slideshow or something).

This was a conscious decision by the UX team:

This will need to be discussed in another issue, but the UX team decided that including the type made the library look cluttered. The items in the library use a new view mode and template, so a theme could implement some custom styling to make types look distinct without just including the type name above the media item name.

Let's talk about that in this issue, and see what we can come up with.

Proposed resolution

Figure out if and how to visually differentiate different media types in the media library.

Remaining tasks

Agree on a course of action, write a patch and iterate it directly into the ground. Then commit it.

User interface changes

The media library may receive new UI elements or functionality.

API changes

None anticipated.

Data model changes

None anticipated.

CommentFileSizeAuthor
#15 2986117-15.png48.03 KBckaotik
#5 issue-2986117-4.PNG4.95 KBckaotik

Comments

phenaproxima created an issue. See original summary.

geek-merlin’s picture

Title: Find a way to differentiate different media types in the media library » Find a way to differentiate different media types in the media library UI

Clarifying.

geek-merlin’s picture

Some UIs (like ubuntu nautilus) stamp the preview image with an overlay, looking like a film roll or the like.

ckaotik’s picture

Some UIs (like ubuntu nautilus) stamp the preview image with an overlay

Is this a suggestion (media could be stamped), or a workaround (it works on ubuntu)? How is this applicable to media types other than videos?

so a theme could implement some custom styling to make types look distinct

This is troublesome when using a generic admin theme instead of a custom one: How is a run-of-the-mill theme supposed to know which kind of media bundles a site uses? We would need to base such styling on the source provider. This does not work well when needing to differentiate between multiple bundles using the same source, e.g. "Public Video" and "Internal Video" bundles.
I don't think it's possible to generically provide such information, and we'd have to rely on some form of custom text or imagery. Even providing a visual indicator to differentiate all the sources shipped with Core will be a lot of options to support.

I was wondering, since the MediaSource plugins already have a default_thumbnail_filename annotation key, maybe we could use that or even add another key (e.g. default_icon_filename) for identification purposes - and maybe eveb make it configurable in the bundle, so site builders can provide a custom icon.
That way we could put an icon, badge, flag or something similar out of the way (in the top left corner maybe?) with an informative title text so the user has access to the information without being overwhelmed by it.

Example media library item with media type badge

ckaotik’s picture

StatusFileSize
new4.95 KB
andrewmacpherson’s picture

Issue tags: +Accessibility

From the issue summary:

Figure out if and how to visually differentiate different media types in the media library.

Renember to convey it non-visually too.

Re: #4

How is a run-of-the-mill theme supposed to know which kind of media bundles a site uses? We would need to base such styling on the source provider. This does not work well when needing to differentiate between multiple bundles using the same source.

This difficulty is one of the reasons we keep the table view display, to provide the user with a useful choice of tools based on what information they need for a given task/website. We realized that some information is hard to convey with an icon/badge, and there isn't much extra room available in the grid. The table view has room for any extra columns you need, so the bundle name is included there as a sortable column by default.

It would be great if the media type can be conveyed in the grid too, but it's not a complete disaster if we can't figure it out.

File fields use an icon based on the major mime type groups, with a fallback for any mime types that are unknown and/or don't have an icon. This doesn't correspond perfectly to media bundles, but having an icon per media source may suit a majority of sites.

An alternative to having icons in the theme, could be to put an "admin icon" imagefield on the bundle, and let site builders upload one.

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.

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

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

phenaproxima’s picture

Status: Active » Needs review
Issue tags: +Usability, +Needs accessibility review, +Needs usability review

Is this issue still needed? The media library is segmented by media type and has been since it was redesigned in Drupal 8.7. Tagging for usability and accessibility review; if everyone agrees that this is out of date, let's close it.

phenaproxima’s picture

andrewmacpherson’s picture

#10:

The media library is segmented by media type and has been since it was redesigned in Drupal 8.7.

You're talking about the media library field widget, I think? The media types are segregated into tab-like groups there.

But in the listings at /admin/content/media, all media types are shown in a mixed listing...

  • The table view display (from media module) shows the media type in a column. The type column is sortable too.
  • The grid view display (from media_libarary module) doesn't show the media type.
  • Both views have a filter for media types, but by default it shows all types. So if you arrive via the toolbar menu, you see a mixed listing.

So for the listing at admin/content/media-grid, this issue is still relevant.

Indicating the media type on each item (view row) could likely help users to understand what it is. Right now, you can't tell the difference between an image thumbnail, and a remote video thumbnail.

Accessibility:

  • There's no particular WCAG-based requirement to display the media type. (But WCAG isn't the be-all-and-end-all of accessibility.)
  • However, if the media type is conveyed, it must be conveyed in an inclusive, accessible way for all users.
  • The general problem noted above - not being able to tell the difference between an image and video - may have a disproportionate impact on users with cognitive impairments. My hunch is that users with working memory impairments would greatly benefit from help to distinguish these.

Leaving the "needs accessibility review" tag on for now, for the other accessibility maintainers.

bkosborne’s picture

Right now, you can't tell the difference between an image thumbnail, and a remote video thumbnail.

Yea, this is the big one for us. We like driving our users toward the grid view for using the media library, but since it doesn't differentiate media types it can be a bit confusing at times.

phenaproxima’s picture

Title: Find a way to differentiate different media types in the media library UI » Find a way to differentiate different media types in the administrative media library grid view

You're talking about the media library field widget, I think? The media types are segregated into tab-like groups there.

But in the listings at /admin/content/media, all media types are shown in a mixed listing...

Ah!! That makes a lot more sense, and you are absolutely correct. I'm going to re-title this issue to make it clear what we're talking about.

ckaotik’s picture

StatusFileSize
new48.03 KB

This is our current solution, using some preprocessing and styling:
Media type displayed on media grid items

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

smustgrave’s picture

Status: Needs review » Needs work

There is no patch to review.

But currently media library has the tabs on the side does that not count?

feyp’s picture

> But currently media library has the tabs on the side does that not count?

This exact question was raised in #10 and has been answered in #12. This is not about the media library field widget. This is about the administrative grid view.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

mgifford’s picture

Issue tags: +wcag111

If we are adding visual images for different types of media, then this is a 1.1.1 SC issue.

chris matthews’s picture

Status: Needs work » Active

I believe the issue status should be "Active" as no patch or merge request is attached to the issue.
https://www.drupal.org/docs/develop/issues/fields-and-other-parts-of-an-...

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.