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.
| Comment | File | Size | Author |
|---|---|---|---|
| #15 | 2986117-15.png | 48.03 KB | ckaotik |
| #5 | issue-2986117-4.PNG | 4.95 KB | ckaotik |
Comments
Comment #2
geek-merlinClarifying.
Comment #3
geek-merlinSome UIs (like ubuntu nautilus) stamp the preview image with an overlay, looking like a film roll or the like.
Comment #4
ckaotikIs this a suggestion (media could be stamped), or a workaround (it works on ubuntu)? How is this applicable to media types other than videos?
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
MediaSourceplugins already have adefault_thumbnail_filenameannotation 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.
Comment #5
ckaotikComment #6
andrewmacpherson commentedFrom the issue summary:
Renember to convey it non-visually too.
Re: #4
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.
Comment #10
phenaproximaIs 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.
Comment #11
phenaproximaComment #12
andrewmacpherson commented#10:
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...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:
Leaving the "needs accessibility review" tag on for now, for the other accessibility maintainers.
Comment #13
bkosborneYea, 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.
Comment #14
phenaproximaAh!! 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.
Comment #15
ckaotikThis is our current solution, using some preprocessing and styling:

Comment #21
smustgrave commentedThere is no patch to review.
But currently media library has the tabs on the side does that not count?
Comment #22
feyp commented> 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.
Comment #24
mgiffordIf we are adding visual images for different types of media, then this is a 1.1.1 SC issue.
Comment #25
chris matthews commentedI 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-...