For Drupal 8.6, we shipped with an experimental media library that:

  1. Provides a nice visual interface for browsing through all the media items in your site
  2. Can be opened from a node form (or similar author-facing context) in order to visually select media items to reference in a field
  3. Provides a way to upload several media assets into Drupal, quickly enter metadata for them, and reference them in a field -- all without having to leave the page you're on

This is the roadmap issue for how we will get this module to "stable" status. The path to stable lies through this jungle of issues:


# Should-have

Accessibility

Usability

Other


# Could-have

Accessibility

Feature requests

Other


# Questionable


# Triage needed


Done

CommentFileSizeAuthor
#148 add-or-select-media.png1 MBwebchick
#140 media-demo-20190315.mp43.39 MBwebchick
#75 2834729-75-02.png29.68 KBphenaproxima
#75 2834729-75-01.png119.84 KBphenaproxima
#72 interdiff-2834729-69-72.txt2.39 KBsamuel.mortenson
#72 2834729-72-view-only.patch46.46 KBsamuel.mortenson
#69 interdiff-2834729-65-69.txt10.12 KBsamuel.mortenson
#69 2834729-69-view-only.patch46.35 KBsamuel.mortenson
#67 interdiff-2834729-65-67.txt2 KBsamuel.mortenson
#67 2834729-67-view-only.patch48.52 KBsamuel.mortenson
#65 interdiff-60-65.txt52.86 KBsamuel.mortenson
#65 2834729-65-view-only.patch47.96 KBsamuel.mortenson
#65 interdiff-2834729-60-65.txt64.5 KBsamuel.mortenson
#60 interdiff-58-60.txt4.16 KBjan.stoeckler
#60 2834729-60.patch83.38 KBjan.stoeckler
#60 2834729-60-with-deps.patch95.3 KBjan.stoeckler
#58 interdiff-54-58.txt8.79 KBjan.stoeckler
#58 2834729-58.patch83.29 KBjan.stoeckler
#58 2834729-58-with-deps.patch95.22 KBjan.stoeckler
#54 2834729-53-with-deps.patch93.55 KBjan.stoeckler
#54 2834729-53.patch81.63 KBjan.stoeckler
#52 2834729-52-with-deps.patch93.55 KBjan.stoeckler
#52 2834729-52.patch84.07 KBjan.stoeckler
#49 interdiff-2834729-43-47.txt6.01 KBchr.fritsch
#48 2834729-47-with-deps.patch33.12 KBchr.fritsch
#48 2834729-47.patch81.63 KBchr.fritsch
#43 media-library-2834729-43-do-not-test.patch80.18 KBseanb
#43 media-library-with-dependencies-2834729-43.patch131.88 KBseanb
#43 interdiff-29-43.txt16.54 KBseanb
#43 interdiff-29-35.txt15.76 KBseanb
#35 2834729-35-dialog buttons.png243.36 KBdyannenova
#35 2834729-35-attach-media.gif2.54 MBdyannenova
#35 2834729-35-add-new-media.gif1.38 MBdyannenova
#35 interdiff-2834729-29-35.txt15.76 KBdyannenova
#35 media-library-with-dependencies-2834729-35.patch306.81 KBdyannenova
#29 interdiff-2834729-23-29.txt4.46 KBsamuel.mortenson
#29 media-library-2834729-29-do-not-test.patch76.19 KBsamuel.mortenson
#29 media-library-with-dependencies-2834729-29.patch303.02 KBsamuel.mortenson
#23 interdiff-2834729-12-23.txt2.7 KBsamuel.mortenson
#23 media-library-2834729-23.patch75.23 KBsamuel.mortenson
#12 interdiff-2834729-10-12.txt10.4 KBsamuel.mortenson
#12 media-library-2834729-12.patch72.75 KBsamuel.mortenson
#10 media-library-2834729-10.patch70.65 KBwebflo
#10 2834729-10.interdiff.txt1.41 KBwebflo
#8 2834729-8.patch70.43 KBwebflo
#8 2834729-8..interdiff.patch2.36 KBwebflo
#6 media-library-field-widget.gif368.05 KBsamuel.mortenson
#6 media-library-standalone-page.gif597.83 KBsamuel.mortenson
#6 media-library-2834729-6.patch70.29 KBsamuel.mortenson

Comments

samuel.mortenson created an issue. See original summary.

samuel.mortenson’s picture

Issue summary: View changes
samuel.mortenson’s picture

Issue summary: View changes
samuel.mortenson’s picture

We're working on an experimental Github project before pulling a patch, which is located here: https://github.com/mortenson/media_library

samuel.mortenson’s picture

Status: Active » Needs work
StatusFileSize
new70.29 KB
new597.83 KB
new368.05 KB

As the Berlin Media Sprint is closing up, I'm uploading a patch of what we have now and have marked the Github project as deprecated, as all development should happen in the issue queues from now on. This patch was worked on by myself and @webflo.

Here's what the module provides so far:

  1. A View called "Media" which visually lists all the media on your site.
  2. An admin page for this View which can be found at /admin/content/media, and the Local Task that links to that page.
  3. An Action Link to allow users to quickly add media from the standalone page.
  4. Derived Local Tasks that allow users to drill down into the library by Type. Each local task corresponds to a contextual filter that is passed to the standalone page (ex: /admin/content/media/video).
  5. A new View Mode for Media Types, specifically designed and styled to look presentable in the Media Library. This also includes a default template and styling (CSS).
  6. Javascript behaviors to allow users to click each Media Item and in turn select it for use in the Bulk Operations form.
  7. Javascript behaviors to persist View selection across multiple pages, filters, etc. This means that you can select a Media Item, browse to a new page, and the selection will still be carried over when submitting the bulk form.
  8. Javascript behaviors to carry on the persistent View selection and extra data from our widget to our custom Views Field.
  9. A new Views select form, similar to Bulk Operations, specifically written for use in our Field Widget.
  10. A new Field Widget which allows users to select Media Items using the Media Library. This could be abstracted to work for any View/Entity Type.

I've also uploaded two animated GIFs showing some of the functionality already "completed":

Media Library standalone page

Media Library field widget

The following core patches are required to use this patch:

  1. #2834801: Schema validation fails on the "entity" argument_validator when the "bundles" form key is not set
  2. #2834777: Refactor Drupal\system\Plugin\views\field\BulkForm to support a select form as well

To facilitate testing and review of this patch, I've added a test submodule called "media_library_test". This module provides two default Media Types, and a Content Type which uses a single and multivalue Media field. I recommend following this flow when testing:

  1. Apply the required core patches (see above).
  2. Enable the "media_library_test" module.
  3. Visit /media/add/type_one, fill in the "Name" field, and submit the form.
  4. Visit /media/add/type_two, fill in the "Name" field, and submit the form.
  5. Visit /admin/content/media and play around with the tabs, filters, and bulk select form.
  6. Visit /node/add/media_library_test and try selecting some media in the two fields. It's worth noting that sorting is not yet implemented in this patch.

There is so much work to be done here, but hopefully this list of major priorities makes sense:

  1. Review the Field Widget, as we've never used a View in a Field Widget before (in core) and I'm not an expert at writing these, and improve it where necessary.
  2. Add drag+drop sorting to the Field Widget to re-order Media Items.
  3. Implement a CKEditor button that allows for embedding Media directly in WYSIWYG.
  4. Add tabs that are similar to /admin/content/media to the Field Widget modal, which should use AJAX to reload the modal with the appropriate contextual filters.
  5. Think about how validation plays into using a View to select Media - if I only allow specific Media Types in my Field, should the View dynamically filter based on those Types?
  6. The mockups showed that you can also add (create, not re-use) Media from the modal - how are we going to accomplish this?
  7. What is expected when the View selection is submitted in the Field Widget - should the new selection replace the existing selection or append to it?
  8. What is expected in the MVP in terms of features - can the MVP just be about re-using existing media like the autocomplete widget?

This patch is by no means ready for a RTBC status, so I'm marking the issue as "Needs work" until we've added all the features we want for the MVP. That said, I would love to get feedback at this stage and would appreciate some help from core contributors who are more experienced than me.

Thank you!

mparker17’s picture

@samuel.mortenson Fantastic work! :) Thank you for helping to move this issue forward!

webflo’s picture

StatusFileSize
new2.36 KB
new70.43 KB
webflo’s picture

+++ b/core/modules/media_library/src/Plugin/Field/FieldWidget/MediaLibraryWidget.php
@@ -317,15 +317,15 @@ public static function addItems($form, FormStateInterface $form_state) {
-            ++$field_state['items_count'];

I realize that, this is not correct. items_count and delta should match. I think we should init items_count with 0 and increase it similar to $delta. or use $delta for the comparison.

Anyway, i added and remove media entities in the widget and the field state was not correct after a few iterations.

webflo’s picture

StatusFileSize
new1.41 KB
new70.65 KB

We should decide if we want to replace the existing selection or always add new items. Its an odd mix atm.

samuel.mortenson’s picture

@webflo Agreed, I think the View should only add items onto the existing selection, but it would be good to get UX feedback on what is expected.

I would propose these changes to the widget, if we go with appending and not replacing:

  1. Change the button that opens the modal to say "Add Media"
  2. When a selection is made, append the selection onto the existing items and call $form_state->setRebuild()
  3. Split updateWidget into two new methods - one for appending items, and one for removal. These would return AJAX commands to remove/add specific items, instead of re-rendering the entire selection area. This allows us to have the widget be sortable without making any extra AJAX requests when you re-sort items.

I'll work on this and try to get a new patch in soon with sorting working.

samuel.mortenson’s picture

StatusFileSize
new72.75 KB
new10.4 KB

This patch:

  1. Removes my use of getUserInput and properly uses form values and/or field state
  2. Adds sorting to items using fairly minimal JS/form logic
  3. Ensures that Media Items you add from the View are always appended to the existing selection
  4. Changes the style of the "Remove" button to use an icon - which looks kind of lame right now but I assume we can get some UX design resources to make something nicer.
samuel.mortenson’s picture

Some quick self-review:

  1. +++ b/core/modules/media_library/icons/checkbox.svg
    @@ -0,0 +1,4 @@
    +<svg fill="#91b6f9" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">
    

    We need to use the libricons mentioned in #2828538: Produce high fidelity screens based on Media prototype.

  2. +++ b/core/modules/media_library/js/media_library.view.js
    @@ -0,0 +1,118 @@
    +  var MediaLibrarySelectedEntities = {};
    

    The persistent selection is really useful for AJAX views - but isn't required for the Media Library to function. @webflo Should this be moved to a new issue?

  3. +++ b/core/modules/media_library/media_library.info.yml
    @@ -0,0 +1,10 @@
    +name: 'Media library'
    

    We need a composer.json change as well, since we're adding a new module to core.

  4. +++ b/core/modules/media_library/media_library.libraries.yml
    @@ -0,0 +1,28 @@
    +      css/media_library.css: {}
    

    We'll eventually need to break this out into functional/theme styles, and copy the theme styles into stable.

  5. +++ b/core/modules/media_library/media_library.module
    @@ -0,0 +1,73 @@
    +function _media_library_pretty_time($time) {
    

    Just a comment - This was added following UX feedback about having relative dates in the View, the only difference between this and the "datetime_time_ago" field formatter is that I set a max age on using relative times. If a Media Item was created over a month ago, we show the full date.

  6. +++ b/core/modules/media_library/src/Plugin/Field/FieldWidget/MediaLibraryWidget.php
    @@ -0,0 +1,365 @@
    +  /**
    +   * {@inheritdoc}
    +   */
    +  public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) {
    

    This function is really long! Maybe we can split it up into protected methods to better support refactors and tests.

  7. +++ b/core/modules/media_library/src/Plugin/Field/FieldWidget/MediaLibraryWidget.php
    @@ -0,0 +1,365 @@
    +  public static function removeItem($form, FormStateInterface $form_state) {
    

    I'm not 100% sure this callback works now that we have sorting in. When we add Javascript testing I'll feel better about the logic here.

In general I think the next step here should be coordination with the UX team to identify MVP goals, and we should start writing tests for the standalone page and the widget before adding entirely new features. I'll plan on writing Javascript tests for the widget this week.

gábor hojtsy’s picture

@samuel.mortenson: re the remove icon, we use libricons for admin facing styling, see https://github.com/ry5n/libricons -- if that has a useful icon for your needs, that would be the most consistent pick.

gábor hojtsy’s picture

Tried applying this patch with https://www.drupal.org/node/2831274 #162 and it says

Fatal error: Class 'Drupal\system\Plugin\views\field\SelectFormBase' not found in /home/d1dti/www/core/modules/media_library/src/Plugin/views/field/SelectMedia.php on line 23

upon installing the modules. Should one also apply #2834777: Refactor Drupal\system\Plugin\views\field\BulkForm to support a select form as well or that is not the latest of what to apply?

gábor hojtsy’s picture

+++ b/core/modules/media_library/tests/modules/media_library_test/media_library_test.info.yml
@@ -0,0 +1,9 @@
+package: Testing

If you can make this not be in the testing package, drive-by testers using simplytest.me could run with the patch and try it out with the test types. That would not be kept for the final version of the patch of course.

samuel.mortenson’s picture

#15 - You'll also need to apply the most recent patch from #2834777: Refactor Drupal\system\Plugin\views\field\BulkForm to support a select form as well, yes. I gave some review instructions in #6 but maybe that comment should be re-factored into the issue summary.

I noticed that in #2660124: Dynamically build layout icons based on well formed config contributors are uploading full patches (including dependencies) for the testbot, then do-not-test patches with just the changes from that issue. I'll start using that format going forward to make review easier.

#16 - Good point, I'll try to get that into the next patch.

berdir’s picture

#16: Doesn't work like that, it is not the package that is being excluded. Drupal doesn't look for modules in tests folder unless some flag is setting settings.php or we're actually running a test. So if you want to make it available, you have to move it to a separate folder, outside of tests.

gábor hojtsy’s picture

@Berdir: thanks. I think it would be useful to have it in a regular module location then to facilitate testing. Alternatively if the document/image/video patches are in a good enough shape, we maybe want to have a compound testing issue for all of them somewhere :) Asking that now on #drupal-media in IRC.

samuel.mortenson’s picture

I attended the UX meeting today and the feedback on way we're handling re-sorting Media was very positive. I think it's safe to say that the way sorting the selection works now is going to be similar to what eventually lands in core.

That said, I still need to write Javascript tests for the field widget as it exists now, make a few styling updates that were suggested by the UX team, and continue to improve the field widget's handling of selections. We'll also need to provide default display mode settings for known Media Types that are going to be committed in core, specifically YouTube, File, and Image. Things are looking good so far though!

gábor hojtsy’s picture

Youtube recording from UX meeting today: http://youtu.be/hf8AovBZflo

samuel.mortenson’s picture

Sorry for the holiday delay! I'm still working on tests, and have started looking into a CKEditor plugin as well. My notes from #13 still need addressed, and I also noticed some quirks when adding/removing/resorting in the field widget. We're also waiting on new icons for edit/remove from the UX team.

samuel.mortenson’s picture

StatusFileSize
new75.23 KB
new2.7 KB

I started working on integration tests and already got stuck! For some reason clicking on the local tasks in the admin view returns a 403, but I can't replicate this in the UI at all. If anyone is a test expert and can figure out why this minimal test fails, let me know! Otherwise I'm waiting for new icons to follow up with the rest of my feedback from #13.

For other contributors, the open tasks for this issue are:

1) Find out why the test in this patch fails
2) Figure out what's required to embed Media in WYSIWYG as a part of this or another patch, and write it :-)
3) Review the Field Widget added in this patch, see if there are bugs when adding/sorting/removing media and address them

berdir’s picture

Your views argument includes a view access check for the passed in media type. But media_type only has an admin permission (administer media types), which your test user doesn't have.

It is an interesting feature obviously, but per-type view access is not something that the current media patch/module provides.

gábor hojtsy’s picture

@samuel.morteson: the embedding problem has its issue at #2801307: [META] Support WYSIWYG embedding of media entities, I see how it needs to be integrated with the library, but it also needs its own components, eg. markup decisions for the embed code, etc.

samuel.mortenson’s picture

@berdir That makes sense, thank you! I'm all set to continue writing tests for the library and field widget now. I'll probably remove the type access check as there is already (view) permission checking on the media items, and a user shouldn't need to administer media types to use the library.

@gábor-hojtsy It makes sense that the WYSIWYG part of this issue would be blocked until that's closed, I'll hold off on that work for now.

So I'll just work on test coverage for now, then circle back to the field widget. Thanks again!

tedbow’s picture

Issue summary: View changes

Crossed out github link in summary because it seems patches are more recent.

Also added link to #2834777: Refactor Drupal\system\Plugin\views\field\BulkForm to support a select form as well in the summary so that it is obvious you need to apply this patch too.

samuel.mortenson’s picture

Issue summary: View changes
samuel.mortenson’s picture

Status: Needs work » Needs review
StatusFileSize
new303.02 KB
new76.19 KB
new4.46 KB

Just getting test coverage working for the standalone page, field widget tests are forthcoming. The "with-dependencies" patch includes the two issues this patch depends on, so please only review the "do-not-test" patch if you're looking into this issue. :)

slashrsm’s picture

#2830691: Improve out of the box UI / UX for Media handling from the contrib Media module is related and could be useful.

gábor hojtsy’s picture

@dyannenova is working on a significantly updated patch for this. (I don't have a way to assign this to her but it should be).

Also we discussed the latest version of that on the UX call today. Here is the recording (very short, just reviewed this): https://youtu.be/LbQis7Va8zg

dyannenova’s picture

Here are my updates on top of the dependencies from #29. This includes styling changes for the media library, and interaction changes, like the toggle for metadata, and hiding actions on the main library page until items are selected.

Here's an example of attaching new media through the library field widget:
attaching media interaction

Work that needs to be done

I've added an example button for adding new media to the top of the library widget, but this needs to be built out to load the form in the modal and lead the user through adding media and back to the library with their newly added item selected.
add new media interaction

Right now the core dialog javascript moves the views filter submit down to the bottom of the dialog. For clarity, this needs to be overridden to move the "Apply filters" button back to the header. The text on the "Selected items" button could also be clearer. On the ux call we discussed using "Attach selected media" instead.
dialog buttons

webflo’s picture

@DyanneNova: Could you upload the last patch without all the dependencies? Thx.

samuel.mortenson’s picture

diff -u b/core/modules/media_library/media_library.links.action.yml b/core/modules/media_library/media_library.links.action.yml
--- b/core/modules/media_library/media_library.links.action.yml
+++ b/core/modules/media_library/media_library.links.action.yml
@@ -6 +5,0 @@
-    - view.media_library.bundle_page
reverted:
--- b/core/modules/media_library/media_library.links.task.yml
+++ /dev/null
@@ -1,8 +0,0 @@
-media_library.local_tasks:
-  deriver: 'Drupal\media_library\Plugin\Derivative\MediaLibraryLocalTasks'
-  weight: 1
-
-media_library.local_tasks.all:
-  title: 'All categories'
-  route_name: view.media_library.page
-  parent_id: views_view:view.media_library.page

Why was the local task deriver removed?

diff -u b/core/modules/media_library/templates/media--media-library.html.twig b/core/modules/media_library/templates/media--media-library.html.twig
--- b/core/modules/media_library/templates/media--media-library.html.twig
+++ b/core/modules/media_library/templates/media--media-library.html.twig
@@ -45,8 +45,6 @@
       <div class="media-library-item-name">{{ name }}</div>
       <div class="media-library-item-created">{{ created_ago }}</div>
-      <div class="media-library-item-author">{{ author_info }}</div>
+      <div class="media-library-item-type">{{ media.bundle()|title }}</div>
     </div>
-    {# This is used to prevent dragging nested elements in the widget. #}
-    <div class="media-library-mask"></div>
   {% endif %}
 </article>

And why was the mask removed?

dyannenova’s picture

The local tasks were removed based on one of the ux meeting discussions, where everyone agreed that they should be changed to views filters.

I removed the mask because I couldn't find a case where it was needed. Where is it being used? Is there a reason we can't target only the top level for dragging?

samuel.mortenson’s picture

@DyanneNova Alright, we'll also need to update MediaLibraryTest as that specifically had coverage for the local tasks.

I found that while re-ordering media items in the field widget using drag and drop, users would sometimes drag the thumbnail image, preventing the default jQuery.ui draggable behavior. You should be able to replicate this by selecting two Media items with thumbnails and re-ordering them while dragging on a thumbnail.

samuel.mortenson’s picture

Issue summary: View changes
berdir’s picture

Component: entity system » media system

I think this makes more sense in the media system component, probably the issue was created before that existed?

seanb’s picture

Rerolled since the main patch landed. I tried to create a interdiff for 29-35 and used that for the reroll, uploading that as well. Found a new issue for the main patch #2880199: Revision user not set when saving media which causes this to break. So hopefully we can that fixed asap.

*edit
In the end everything works by the way! The admin/content/media page is a little weird (since you can't seem to do anything like edit or delete media items). But picking stuff from the library looks awesome! Nice work!

idebr’s picture

Enabling Media library media-library-with-dependencies-2834729-43.patch results in a fatal error:

Fatal error: Class 'Drupal\system\Plugin\views\field\SelectFormBase' not found in /[...]/core/modules/media_library/src/Plugin/views/field/SelectMedia.php on line 23

seanb’s picture

You need to apply #2834777: Refactor Drupal\system\Plugin\views\field\BulkForm to support a select form as well first. I guess that patch should be added to the dependencies patch.

marcoscano’s picture

#44 is right, there was a namespace typo in the base class. The attached patch solves it.

Also, moved the config objects from install to optional to allow easy install/uninstall/install without Drupal complaining that the objects already exist in config.

The "-with-dependencies" patch already includes #2834777-17: Refactor Drupal\system\Plugin\views\field\BulkForm to support a select form as well, the other one is the media library patch only.

chr.fritsch’s picture

Title: Create an MVP for adding and re-using Media » [PP-2] Create an MVP for adding and re-using Media
Issue summary: View changes
Status: Needs work » Postponed
Issue tags: +Media Initiative
Related issues: +#2877383: Add action support to Media module, +#2834777: Refactor Drupal\system\Plugin\views\field\BulkForm to support a select form as well
StatusFileSize
new81.63 KB
new33.12 KB

So I rerolled this patch and fixed a few coding style issues.
I also added media_library view displays for image and file.

This issue is currently also blocked by #2877383: Add action support to Media module

chr.fritsch’s picture

StatusFileSize
new6.01 KB

Forgot the interdiff

phenaproxima’s picture

Title: [PP-2] Create an MVP for adding and re-using Media » [PP-1] Create an MVP for adding and re-using Media
Status: Postponed » Needs work
Issue tags: -D8Media +Needs reroll

#2877383: Add action support to Media module is in. Let's give this a re-roll.

jan.stoeckler’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
StatusFileSize
new84.07 KB
new93.55 KB

Rerolled patch attached, was well as -with-deps.patch for testing purposes.

jan.stoeckler’s picture

StatusFileSize
new81.63 KB
new93.55 KB

Sorry, git mishap, should be applying now.

jan.stoeckler’s picture

Status: Needs work » Needs review
StatusFileSize
new95.22 KB
new83.29 KB
new8.79 KB

This should fix some of the test failures.

jan.stoeckler’s picture

Status: Needs work » Needs review
StatusFileSize
new95.3 KB
new83.38 KB
new4.16 KB

These changes fix errors that arise when using more than one instance of this new widget per form, and when those instances are on fields with the same field name.

samuel.mortenson’s picture

👋Hello everyone - I wanted to give an update on this issue based on the discussions we had at Drupalcon Nashville last week.

The plan right now is to land the MVP in three parts, each committed separately. Those parts are:

  1. Just the Media Library View and Display Mode, with no Field Widget code and no dependencies on other issues. This will make it easier to get something into core, and will let reviewers focus on styling and usability instead of the Field Widget. This will essentially be a re-roll of #60, and may happen in this issue. We'll try to get the credit moved over if this needs to be in a new issue.
  2. A Field Widget for re-using Media based on the patches in this issue. This will be loosely based on #60, but may be refactored a bit so that uploading (or entering an OEmbed URL) is also easy to do in the modal. This will happen in its own issue.
  3. An addition to the Field Widget to create new Media, probably based on the patches from #2938116: Allow media to be uploaded with the Media Library field widget. The work will happen in that issue, most likely.

All of this work will happen in a separate experimental Media Library module, which will be easy to iterate on in the 8.6.x development cycle. Ideally we would finish all three tasks and then open another issue to move all the code into the main Media module, which would mean it becomes stable in 8.6.x.

I will try to get a patch for #1 uploaded today or tomorrow, either in this issue or a new one. Let's finally get this in!

phenaproxima’s picture

I concur with the plan outlined above, and have committed myself as the one to review this code regularly in order to keep @samuel.mortenson and other contributors unblocked.

Let's do this.

phenaproxima’s picture

Title: [PP-1] Create an MVP for adding and re-using Media » Create an MVP for adding and re-using Media
Issue tags: -sprint

Also, I just realized that we're not postponed anymore, so removing that from the issue title.

samuel.mortenson’s picture

StatusFileSize
new64.5 KB
new47.96 KB
new52.86 KB

Here's an updated patch based on #60 that removes all Field Widget related code. I also moved our Javascript to ES6, added optional configuration for Audio and Video media, and added a link to view the Media items (I think we forgot about that, and just focused on Bulk Upload :P).

This issue may be too noisy to iterate on this patch, but I wanted to upload it here first to get visibility on it. If core maintainers want a new issue we can make one and carry the issue credit over.

Edit: interdiff-60-65.txt is the real interdiff with #60 (without deps), interdiff-2834729-60-65.txt is a mis-upload. 🤦‍♂️

samuel.mortenson’s picture

Status: Needs work » Needs review
StatusFileSize
new48.52 KB
new2 KB

Attempted to fix test errors.

phenaproxima’s picture

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

This looks really promising.

I've asked @starshaped to review the CSS in various browsers/themes, so I'll tag this for screenshots.

  1. +++ b/core/modules/media_library/config/install/views.view.media_library.yml
    @@ -0,0 +1,428 @@
    +          row_class: media-library-item
    

    I'm wondering if we should make this a more generic class (and update the CSS/JS to match) so that other parts of Drupal could use the same pattern we're implementing here. Do you think that would be a lot of work? It's a decision we should make now, since changing existing views in update hooks is a nightmare.

  2. +++ b/core/modules/media_library/config/install/views.view.media_library.yml
    @@ -0,0 +1,428 @@
    +      filters:
    

    Should we add "created time" or "author" filters by default here? Not sure how much is too much.

  3. +++ b/core/modules/media_library/config/install/views.view.media_library.yml
    @@ -0,0 +1,428 @@
    +      tags:
    +        - 'config:core.entity_view_display.media.audio.default'
    +        - 'config:core.entity_view_display.media.file.default'
    +        - 'config:core.entity_view_display.media.file.media_library'
    +        - 'config:core.entity_view_display.media.image.default'
    +        - 'config:core.entity_view_display.media.image.media_library'
    +        - 'config:core.entity_view_display.media.video.default'
    

    Why don't we have entity view displays for audio and video media types too?

  4. +++ b/core/modules/media_library/config/optional/core.entity_view_display.media.audio.media_library.yml
    @@ -0,0 +1,29 @@
    +content:
    +  thumbnail:
    +    type: image
    +    weight: 0
    +    region: content
    +    label: hidden
    +    settings:
    +      image_style: medium
    +      image_link: ''
    +    third_party_settings: {  }
    

    Why is 'name' hidden in this view display, but not the File media type's?

  5. +++ b/core/modules/media_library/js/media_library.view.es6.js
    @@ -0,0 +1,73 @@
    +        if ($(this).parents('.media-library-item').hasClass('expanded')) {
    +          $(this).parents('.media-library-item').removeClass('expanded');
    +        }
    +        else {
    +          $(this).parents('.media-library-item').addClass('expanded');
    +        }
    

    Couldn't we use toggleClass() here?

  6. +++ b/core/modules/media_library/js/media_library.view.es6.js
    @@ -0,0 +1,73 @@
    +  Drupal.behaviors.MediaLibraryHover = {
    +    attach: function (context) {
    +      $('.media-library-item .media-library-item-preview', context).once('media-library-item').on('mouseover', function () {
    +        $(this).parents('.media-library-item').addClass('is-hover');
    +      }).on('mouseout', function () {
    +        $(this).parents('.media-library-item').removeClass('is-hover');
    +      });
    +    }
    +  };
    

    Is there any way this could be accomplished with CSS only? I guess the fact that we're changing the parent makes it impossible, but it was worth asking again...

  7. +++ b/core/modules/media_library/media_library.install
    @@ -0,0 +1,22 @@
    +function media_library_install() {
    +  // Disable the /admin/content view provided by media, so that we can properly
    +  // override it.
    +  /** @var \Drupal\views\Entity\View $view */
    +  if ($view = View::load('media')) {
    +    $display = &$view->getDisplay('media_page_list');
    +    $display['display_options']['enabled'] = FALSE;
    +    $view->save();
    +  }
    +}
    

    Should we provide an uninstall hook to do the inverse?

  8. +++ b/core/modules/media_library/media_library.module
    @@ -0,0 +1,71 @@
    + * Contains hook implementation for the media_library module.
    

    "implementation" should be plural.

  9. +++ b/core/modules/media_library/media_library.module
    @@ -0,0 +1,71 @@
    + * @todo This might be suitable for core as a Twig function.
    

    Follow-up?

  10. +++ b/core/modules/media_library/media_library.views.inc
    @@ -0,0 +1,25 @@
    +  foreach (\Drupal::entityTypeManager()->getDefinitions() as $entity_type => $entity_info) {
    +    $data[$entity_info->getBaseTable()][$entity_type . '_select_media'] = [
    +      'title' => t('Select media'),
    +      'help' => t('Provides a field for selecting media entities in our media library view'),
    +      'real field' => $entity_info->getKey('id'),
    +      'field' => [
    +        'id' => 'select_media',
    +      ],
    +    ];
    +  }
    

    Why are we exposing this for every entity? Shouldn't it just be for media items?

  11. +++ b/core/modules/media_library/templates/media--media-library.html.twig
    @@ -0,0 +1,53 @@
    + * Other themes are welcome to override this template, which will not break the
    + * functionality of the library.
    

    I'm wondering if we should prove this with a test, since the JS is heavily class-based. I'm also wondering if it might not be a better idea to use data attributes so that we can wrap important markup in Attributes objects, rather than expecting themes to keep the CSS classes.

samuel.mortenson’s picture

Status: Needs work » Needs review
StatusFileSize
new46.35 KB
new10.12 KB

Addressing #68 -

  1. We could do this - are you thinking that other Views would want the same click-to-check functionality that this patch provides? Where would this live?
  2. I think we based the filters off of what the /admin/content View has, which is why there is no author filter. Maybe in UX review we can determine if there's enough there.
  3. I exported the View after optional config for the media types was installed, which was wrong - the view should have no dependencies or references to file/image/etc. Fixed.
  4. Hid this for all types, thanks.
  5. Done - used toggle class in another place as well.
  6. Not with the way this is currently styled, no. The hidden checkbox is only checked if the preview (top part of card) is checked, so we only want to have a hover effect if clicking will actually check the checkbox.
  7. Done.
  8. Done.
  9. We need to create a follow up for this, if we still think it's a good idea for other Twig templates. I can create an issue and update the doc block before RTBC.
  10. This file should have been deleted - it was only necessary for the Field Widget.
  11. This is a standard template so overrides should definitely work, I don't think extra test coverage is necessary. That said, anyone overriding the template will need to keep certain classes around for the JS to work, so I updated the doc block.
phenaproxima’s picture

Issue tags: +Needs usability review

We could do this - are you thinking that other Views would want the same click-to-check functionality that this patch provides? Where would this live?

Yes, I'm imagining exactly that, and I imagine it would live in Views. We don't have to put it in Views right now, but let's bear this idea in mind and "groom" it for eventual movement into Views.

I think we based the filters off of what the /admin/content View has, which is why there is no author filter. Maybe in UX review we can determine if there's enough there.

I concur. Let's get UX eyes on that.

We need to create a follow up for this, if we still think it's a good idea for other Twig templates. I can create an issue and update the doc block before RTBC.

Sounds good. Please do!

This is a standard template so overrides should definitely work, I don't think extra test coverage is necessary. That said, anyone overriding the template will need to keep certain classes around for the JS to work, so I updated the doc block.

Okay, that sounds like a good compromise.

samuel.mortenson’s picture

Status: Needs work » Needs review
StatusFileSize
new46.46 KB
new2.39 KB

Quick fix for tests.

phenaproxima’s picture

Status: Needs review » Needs work

Looking excellent!

  1. +++ b/core/composer.json
    --- /dev/null
    +++ b/core/misc/icons/787878/check.svg
    

    Do we need additional variants of this icon for other color schemes? (That's probably a question for the UX team.)

  2. +++ b/core/modules/media_library/config/install/views.view.media_library.yml
    @@ -0,0 +1,418 @@
    +          row_class: media-library-item
    

    Let's change this class to something more generic, so that we can (ideally) bring this click-to-select functionality into Views. Any ideas for what to call it? Maybe 'click-to-select'?

  3. +++ b/core/modules/media_library/config/install/views.view.media_library.yml
    @@ -0,0 +1,418 @@
    +        media_bulk_form:
    

    Again, to groom this functionality for inclusion into Views, let's rename the plugin now (click_to_select or something like that, or maybe just 'selection').

  4. +++ b/core/modules/media_library/config/install/views.view.media_library.yml
    @@ -0,0 +1,418 @@
    +          element_class: media-library-item-checkbox
    

    Same here.

  5. +++ b/core/modules/media_library/config/install/views.view.media_library.yml
    @@ -0,0 +1,418 @@
    +          element_class: media-library-item-content
    

    Should this also be made "generic"? If so, something like 'selectable-content' might make more sense.

  6. +++ b/core/modules/media_library/config/install/views.view.media_library.yml
    @@ -0,0 +1,418 @@
    +      filters:
    

    I will be demoing the library to the UX team today and will ask them about the filters. Specifically, whether we have enough, or should have different ones out of the box.

  7. +++ b/core/modules/media_library/config/optional/core.entity_view_display.media.audio.media_library.yml
    @@ -0,0 +1,29 @@
    +    - field.field.media.audio.field_media_audio_file
    

    Why is this dependency here? It's not used in the view display; it's really just a dependency of the media type, no? Can we remove it, or was it automatically calculated?

  8. +++ b/core/modules/media_library/config/optional/core.entity_view_display.media.file.media_library.yml
    @@ -0,0 +1,29 @@
    +    - field.field.media.file.field_media_file
    

    Same here.

  9. +++ b/core/modules/media_library/config/optional/core.entity_view_display.media.image.media_library.yml
    @@ -0,0 +1,29 @@
    +    - field.field.media.image.field_media_image
    

    Same here.

  10. +++ b/core/modules/media_library/config/optional/core.entity_view_display.media.video.media_library.yml
    @@ -0,0 +1,29 @@
    +    - field.field.media.video.field_media_video_file
    

    And here.

  11. +++ b/core/modules/media_library/css/media_library.css
    @@ -0,0 +1,144 @@
    +#views-form-media-library-page {
    +  display: flex;
    +  flex-wrap: wrap;
    +  align-content: space-between;
    +}
    

    It's SO nice to be able to use flexbox. However, I wonder if we shouldn't make these into generic classes so as to eventually merge this CSS into Views.

  12. +++ b/core/modules/media_library/css/media_library.css
    @@ -0,0 +1,144 @@
    +  font-size: 12px;
    

    I'm not entirely certain we're supposed to size type in pixels. This file needs review from a CSS expert who knows the standard practices for core CSS.

  13. +++ b/core/modules/media_library/js/media_library.view.es6.js
    @@ -0,0 +1,63 @@
    +        // Links inside the rendered media item should not be click-able.
    +        event.preventDefault();
    

    I'm not sure this will have the intended effect (to prevent links in the rendered content from being clicked). If it indeed does, we should prove that with a functional JavaScript test.

  14. +++ b/core/modules/media_library/js/media_library.view.es6.js
    @@ -0,0 +1,63 @@
    +        $(this).parents('.media-library-item').toggleClass('checked', $input.prop('checked'));
    

    Can we use .closest() here, for clarity?

  15. +++ b/core/modules/media_library/js/media_library.view.es6.js
    @@ -0,0 +1,63 @@
    +        if ($('.media-library-item.checked').length) {
    

    Can't we just check $input.prop('checked')?

  16. +++ b/core/modules/media_library/js/media_library.view.es6.js
    @@ -0,0 +1,63 @@
    +      // Add the toggle when javascript is available
    

    I don't think we need this comment. Anything in a JavaScript file will only be taking place if JavaScript is available :)

  17. +++ b/core/modules/media_library/js/media_library.view.es6.js
    @@ -0,0 +1,63 @@
    +        $(this).parents('.media-library-item').toggleClass('expanded');
    

    I think we can prefer .closest().

  18. +++ b/core/modules/media_library/js/media_library.view.es6.js
    @@ -0,0 +1,63 @@
    +      $('.media-library-item .media-library-item-preview', context).once('media-library-item').on('mouseover', function () {
    +        $(this).parents('.media-library-item').addClass('is-hover');
    +      }).on('mouseout', function () {
    +        $(this).parents('.media-library-item').removeClass('is-hover');
    +      });
    

    I think we could use .closest() here too.

  19. +++ b/core/modules/media_library/media_library.info.yml
    @@ -0,0 +1,10 @@
    +  - drupal:user
    

    Not a big deal, but why do we have the explicit dependency on User?

  20. +++ b/core/modules/media_library/media_library.libraries.yml
    @@ -0,0 +1,17 @@
    +  dependencies:
    +    - core/drupal
    +    - core/jquery
    +    - core/jquery.once
    

    I believe jquery.once already depends on jquery, so we can remove the explicit jquery dependency.

  21. +++ b/core/modules/media_library/media_library.links.action.yml
    @@ -0,0 +1,5 @@
    +media_library.add:
    +  route_name: entity.media.add_page
    +  title: 'Add media'
    +  appears_on:
    +    - view.media_library.page
    

    The test should assert that this link actually appears.

  22. +++ b/core/modules/media_library/media_library.module
    @@ -0,0 +1,84 @@
    +/**
    + * Displays a timestamp in a human-readable fashion.
    + *
    + * @todo This might be suitable for core as a Twig function.
    + *
    + * @param int $time
    + *   A timestamp.
    + *
    + * @return \Drupal\Core\StringTranslation\TranslatableMarkup
    + *   Markup representing a formatted time.
    + */
    

    If we're going to move this into core as a Twig function, let's also mark it @internal.

  23. +++ b/core/modules/media_library/templates/media--media-library.html.twig
    @@ -0,0 +1,52 @@
    + * Other themes are welcome to override this template, as long as the
    + * "media-library-item-preview" and "media-library-item-attributes" classes are
    + * present in the template override.
    

    Would it helpful to use data attributes, and/or Attributes objects, for these purposes? Like <div data-media-library-component="preview"> and <div data-media-library-component="attributes"> or something? It might separate the concerns a little more cleanly.

  24. +++ b/core/modules/media_library/templates/media--media-library.html.twig
    @@ -0,0 +1,52 @@
    + * - created_ago: This is a Media Library specific variable that contains a
    

    Nit: need a hyphen between "Library", and "specific", e.g. "Media Library-specific".

  25. +++ b/core/modules/media_library/tests/src/FunctionalJavascript/MediaLibraryTest.php
    @@ -0,0 +1,86 @@
    +  public function testAdministrationPage() {
    +    // Visit the administration page.
    +    $this->drupalGet('admin/content/media');
    +
    +    // Verify that media from two separate types is present.
    +    $this->assertSession()->pageTextContains('media_1');
    +    $this->assertSession()->pageTextContains('media_3');
    +
    +    // Test that users can filter by type.
    +    $this->getSession()->getPage()->selectFieldOption('Media type', 'Type One');
    +    $this->getSession()->getPage()->pressButton('Apply Filters');
    +    $this->assertSession()->assertWaitOnAjaxRequest();
    +    $this->assertSession()->pageTextContains('media_2');
    +    $this->assertSession()->pageTextNotContains('media_4');
    +    $this->getSession()->getPage()->selectFieldOption('Media type', 'Type Two');
    +    $this->getSession()->getPage()->pressButton('Apply Filters');
    +    $this->assertSession()->assertWaitOnAjaxRequest();
    +    $this->assertSession()->pageTextNotContains('media_2');
    +    $this->assertSession()->pageTextContains('media_4');
    +
    +    // Test that selecting elements as a part of bulk operations works.
    +    $this->getSession()->getPage()->selectFieldOption('Media type', '- Any -');
    +    $this->getSession()->getPage()->pressButton('Apply Filters');
    +    $this->assertSession()->assertWaitOnAjaxRequest();
    +    $this->getSession()->executeScript('jQuery(".media-library-item").click()');
    +    $this->submitForm([], 'Apply to selected items');
    +    $this->assertSession()->pageTextContains('media_1');
    +  }
    

    Let's call assertSession() once at the top of the method and keep re-using the result of that.

    Also, can we definitively assert that thumbnails are being displayed and names are not? Additionally, let's assert that bulk actions are present and functioning as expected.

phenaproxima’s picture

StatusFileSize
new119.84 KB
new29.68 KB

EDIT: Redacted. See #74.

phenaproxima’s picture

Removing screenshots for the bug that wasn't.

phenaproxima’s picture

Open questions for the UX meeting today:

  • Does a grid layout like this one raise any accessibility concerns?
  • Is it confusing for bulk actions to only appear if media items are selected? Should we show them at all times instead, and display empty text?
  • Do we have too many filters? Too few? Are the ones that we have already very useful?
  • Are there any styling problems that stand out?
  • Should we visually distinguish between published and unpublished media items?
  • The creation time is quite plain (e.g. "18 minutes ago"). Should we say something like "Created 18 minutes ago"? Would update time be more useful? Is there any other metadata we should include?
phenaproxima’s picture

Issue tags: -Needs usability review

We discussed this in the UX call today. The takeaways...

  • The media library introduces a few new UX patterns in core. That means it needs extra scrutiny from the UX, accessibility, and design teams.
  • We'll need to sort their feedback into must-haves (major things that should block commit of this patch), and polish (which we can file major follow-up issues for and incorporate into the Media Initiative's roadmap).
  • The media library should incorporate some standard "empty text" when there are no items to display.
  • It is very jarring for the bulk actions to only appear when items are selected. Although it's not very pretty, let's just show the actions at all times (they should automatically disappear if the view is empty). Fixing the look n' feel of Views-provided filters and actions is beyond the scope of this patch, and there is prior art concerning that problem space, so we can punt on that for now.
  • It's not clear how to distinguish between published and unpublished media items in the media library. This needs design input.
  • One accessibility thing we should do is ensure that users can tab between the items in the library, press a key (space?) to select them, and hit another key (enter?) to visit them.
  • There is no visual indication that a media item is supposed to be clicked on. One idea is to have an empty circle in the top right of each item, which is filled in with a checkmark when the item is clicked on. The only problem there is that an empty circle may not be visible with certain images, due to low contrast. This is another problem that needs design input, in order to ensure that the "selection target" is foolproof, visually speaking.
  • The right-pointing chevron is weird -- it connotes a link to another page, rather than expanding or collapsing the item's metadata. Again, we need design input on this. One existing core pattern we could adopt is how the admin toolbar looks when it’s laid out vertically — collapsible sections use downward-pointing chevrons when they are collapsed, and upward-pointing chevrons when they are expanded.
  • It's not clear if the metadata should expand downward (below the thumbnail), or upward (covering the thumbnail). This needs design and UX input.
  • The media library has no drop buttons for editing or deleting media items. This is basically a regression compared to the current state of things. How can we integrate drop button actions into the media library? Should we even try? UX and design input is needed here.
  • How will we support site builders displaying additional metadata? Do we even plan to support that? If so, will it be part of the collapsible metadata for each item? If it will be, what happens if they stuff a lot of metadata in there? This needs UX input.
  • We might want to allow users to toggle between the media library grid, and the old table-based list. This is definitely a follow-up, though.
phenaproxima’s picture

Title: Create an MVP for adding and re-using Media » [META} Create an MVP for adding and re-using Media
Assigned: dyannenova » Unassigned
Issue summary: View changes
Issue tags: -Needs screenshots

We discussed this in the weekly Media meeting this morning. We decided to continue this work in a more organized set of child issues and convert this issue into a meta, with an updated issue summary.

phenaproxima’s picture

Title: [META} Create an MVP for adding and re-using Media » [META] Create an MVP for adding and re-using Media

Whoops, little typo in the issue title.

phenaproxima’s picture

Issue summary: View changes

Sigh, minor typos in the IS.

peterx’s picture

A question about testing this module along side Media entity browser. Is this module intended as a 100% replacement for Media entity browser? If so, I will track this issue and test the alpha/beta code. If not, which issue is the right one to track?

phenaproxima’s picture

@peterx, this is not intended to replace Entity Browser at all. It fulfills a bare-bones use case for reusing media, whereas Entity Browser provides infinitely more opportunities for customization. You're certainly welcome to test it, but bear in mind that the media library has a much smaller scope than Entity Browser, and that's by design. :)

phenaproxima’s picture

Issue summary: View changes
andrewmacpherson’s picture

Issue summary: View changes
Issue tags: +Needs issue summary update

Adding some triage headings for the raodmap: must-have, should-have, could-have. I've filled in a few a11y must-haves, and I hope the main initiative team can update the rest.

andrewmacpherson’s picture

Issue summary: View changes
andrewmacpherson’s picture

re: #78

We might want to allow users to toggle between the media library grid, and the old table-based list. This is definitely a follow-up, though.

Massive +1000 from me. That's a really useful thing for accessibility. Not so much for specific WCAG conformance criteria, but a bunch of benefits that are harder to test objectively...

  • Offering users a choice of tools is a recognized principle of inclusive design. If you find one interface awkward, try the other.
  • Keeping the familiar interface available while they're still leaning the new one, a good strategy to support users with cognitive/learning impairments.
  • Reduce frustration for users who might otherwise be annoyed that you took their old tool away, when it worked just fine.
  • Many screen readers provide some power tools for navigating table content. Users who are confident with these can save a lot of time with things like "jump to end of row", or quickly going down the title column while ignoring the other fields.
  • Sorting the list can easier to understand with a table.
  • Reviewing selections (before running bulk-operations) might be easier with a table, too.
  • You can fit more items in the viewport with a table than with a card grid. Less scrolling needed for speech control users.
andrewmacpherson’s picture

samuel.mortenson’s picture

Issue summary: View changes
Status: Needs work » Active
Issue tags: -Needs issue summary update

The Media Library module, field widget, and upload functionality landed! I updated the issue summary with a ton of follow ups.

phenaproxima’s picture

phenaproxima’s picture

Title: [META] Create an MVP for adding and re-using Media » [META] Roadmap to stabilize Media Library
phenaproxima’s picture

geek-merlin’s picture

geek-merlin’s picture

IMHO critical bug so must-have. Escalated that issue to major only to not bikeshed over the prio.

phenaproxima’s picture

Issue summary: View changes
phenaproxima’s picture

While sprinting on the media library in Barcelona, the team decided to discuss our assumptions regarding the UX and designs, and make them explicit. So here they are, in no particular order:

  • We assume that most of the time, users want to add media to the library, rather than reuse items from it. So, although we need to support reuse, we can optimize the UI for the adding media use case.
  • We assume that the media library does not have thousands upon thousands of items in it with tons of complex metadata; in that case, we assume users will use a DAM or other tool more powerful than Media Library.
  • When adding media, we assume that users know what media type they are trying to add. So the burden of disambiguation is on the user, not Drupal.
  • We assume that most sites don’t have an excessive number of media types. We are designing for a site with maybe 5-10 distinct media types, each of which has a clear and well-defined function.
  • We assume that users want to add captions to media that is embedded in formatted text. So we are assuming that if media items have a caption field, users will want to override it on a per-usage basis. We are also assuming that captions are distinct from alt text and serve a different function, which means users will want to override alt text as well.
  • We assume people don’t mind clicking a button to bring up a modal, in which they can do media stuff. This is necessary due to technical limitations that are pervasive throughout Drupal core.
  • We assume that everything you do in the media library modal affects canonical media items, not individual embeds or references. What happens in the media library “stays in the media library”.
  • Conversely, anything you do to media items that are linked in a field widget, or embedded in formatted text (not in the modal) is affecting that particular reference/embed, not the canonical item. Nothing ever crosses this boundary. In other words, we are assuming that users see the media library as the canonical, absolute place where media items “live” in their Drupal site. If something is deleted from there, it’s gone from everywhere. If something is changed from there, it (or at least its defaults) are changed everywhere. And we are assuming that users see individual references/embeds/usages as part of the “host” entity, rather than as a canonical thing unto itself.
  • We are assuming that people don’t mind making a few more clicks, as long they are always completely entirely clear on what they’re doing. This is consistent with the “don’t make me think” principle. They’re not counting clicks. If they know at a glance where they need to click, they will click. We will strive to keep the number of clicks as low as possible, but we will favor clarity over a low click count.

Overall, we want to build a terrific media library that offers an excellent out-of-the-box experience for relatively simple use cases. Media management is a very complicated problem space, and it's impossible to build something that will please everyone and work for every situation. Complicated use cases, then, will probably need contrib solutions like Entity Browser, and we're comfortable with that; the points above, then, are what we believe constitutes a "relatively simple" use case, and what we intend to optimize for.

feyp’s picture

I was asked to provide some feedback on this list as well, so here is my take on it from our perspective. I'm of course entirely aware that our customers might not reflect the vast majority of users out there and some might even be very special cases.

We assume that most of the time, users want to add media to the library, rather than reuse items from it.

The main reasons why our customers want a media library or like the concept, when we suggest it to them, are:

  • When they need to update a media item they can do it in one place and the change will be reflected throughout the site.
  • It is easy to find and reuse existing media items based on media meta data.
  • To facilitate reuse of existing media items over adding new ones (for various reasons, I can go into more detail, if needed).
  • To use media from a remote system (e.g. an external asset management system).

For the last two cases I think that a UX that treats reusing existing media as a second class citizen would be far from ideal. On the other hand it would probably depend a lot on the final implementation.

Especially for the last case, we have some systems where content editors can't add media in the CMS at all. If they want to use new media items, they have to add it to the external asset management system and then search and select it in the CMS.

Another common pattern with very large organizations is, that customers ask to have special roles for editors that can add and update media items. Mostly, this is for policy reasons (maintaining a certain quality or a consistent design/marketing message, ensuring accessibility requirements are met, ensuring the customer has copyright for a media item and it is properly set in the metadata, etc.).

The feedback that we receive from customers, also from medium or small customers that start from an empty system, is, that once they have created a certain number of media items, they tend to be using the select feature more often over adding new items and they like that they can just select an item that's already there without having to upload the files again and filling in all the necessary meta data again. It saves valuable time in the editing process. I have to admit that this depends somewhat on how easy it is to add new items, so it might be mitigated by the ideal UX for adding new items ;).

Another example that comes to mind: Some customers require their editors to use at least one image for every piece of content. Again, there are different reasons for that and you can argue if it is a sane policy or not. However, in those cases the customer usually has a large number of stock images in its media library that they can choose from for content that doesn't come with an image, which is often the majority of content. This is especially true for some of our customers from the publishing industry.

In principal, I agree that adding media e.g. through the field widget should be straight forward and is a very important use case, but I would not differentiate between adding and reusing media. From the feedback we receive from our customers, I think they are equally important and common use cases.

We assume that most sites don’t have an excessive number of media types. We are designing for a site with maybe 5-10 distinct media types, each of which has a clear and well-defined function.

I already mentioned that one before in a discussion with seanb: Especially some of our large customers (think of a federal government agency, the website of a large city, a large academic institution, a large NGO) tend to have a requirement for more than 5-10 media bundles. At the field level this is indeed not a problem since we usually only allow a few bundles per field, but when it comes CKEditor integration, we usually allow to embed any type and the interface has to work with that.

We are assuming that people don’t mind making a few more clicks, as long they are always completely entirely clear on what they’re doing.

This is something I personally agree with, however we often get feedback from customers large, medium and small that a click on button x is not needed or why do I have to click on this and then on that, wouldn't it be enough to just click on this and then the action is done automatically? Given how often this comes up, it seems that content editors are very sensible to clicks that could be saved, especially if they work with the system for some time. W/r/t media library for example, a regular request of our customers is to just select a media item as soon as a user clicks on it for fields with a cardinality of just 1 item. "Why do I have to click on 'Select'?" is a regular question. When I explain that this is (probably) done to keep it consistent with fields that have a cardinality greater than 1 and it is more clear to users not as familiar with the system, they insist that they want this. "We will mention it during training, it is more important for us to be able to quickly get things done. As soon as a user uses the feature once, they will learn how it works and expect it the next time", etc.

I can 100% agree with the rest of your assumptions, they are in line with how we think our customers are using the system and with the feedback we receive.

I hope this was helpful to you. If I should elaborate on any of the points or you have any questions, let me know.

peterx’s picture

When someone decides to use something extra from media, such as EXIF info, is it intended that they install a replacement for media library or should developers look at creating modules to add on to media library?

bkosborne’s picture

Conversely, anything you do to media items that are linked in a field widget, or embedded in formatted text (not in the modal) is affecting that particular reference/embed, not the canonical item.

I don't think I understand this. How would this look practically? If users selected a media item from the library on a media reference field, then that media item becomes "detached" from the library?

peterx’s picture

When someone selects a media item, say an image, and replaces it, every reference will get the new image.
When someone selects a reference and changes it, the reference would point to a difference media item, the original item will remain unchanged, and all other references to the original will continue to point to the original.

what is not defined is what happens when the original is deleted. There would be references pointing to nothing. Presumably there would be a warning about deleting an item before all references to the item are changed. There would also be a list of all references to the item so that you can change or delete all references before deleting the item.

phenaproxima’s picture

what is not defined is what happens when the original is deleted.

Media fields are simple entity reference fields -- at the data layer, there is nothing different about them at all. The media library is just a nice interface for them, but they are still standard entity reference fields. So the same thing would happen as when you delete a node or taxonomy term (or any other entity) that is referenced from an entity reference field.

berdir’s picture

And because it is a standard ER field, it means you can use the entity_usage project, which in the latest version, has configurable (per entity type) messages on the edit and delete form that warns users about existing usages.

Some thoughts/questions:

* What is the place of the entity browser project? I don't think media library aims to provide the same extensibility as entity browser does, so there is still a place for that IMHO, e.g. to integrate external DAM systems like we did for e.g. Bynder. Would be really neat if we could update entity browser to benefit from the UX improvements done here. Or do you think the media library will be extensible enough to cover that and entity browser might just become a way to configure it, so similar architecture without the UI to change it?
* You mention a lot of assumptions, the question is whether there will be ways to change them. For example, dropzonejs also doesn't offer any type-detection out of the box, but it does have events which we are using to do exactly that in our distribution.
* I do agree with the library vs local behavior and what affects what, we treat that the same. Question is, how exactly do you plan to achieve per-usage description/alt text? A regular ER field can not handle that, it would need a custom type, actually just like the current image field type which is a reference + per-placement alt/title. Except it is more complex than that, because each media type will have different fields, e.g. a youtube video type will not have an alt text. Also, that isn't really a media library feature as it's actually by definition outside of it :)

seanb’s picture

Issue summary: View changes

Added a bunch of new issues based on the new designs being created in #3019150: Update/improve mockups and designs for the media library.

Also reevaluated the priority of issues with webchick and phenaproxima. The list is now more or less in the right order.

andrewmacpherson’s picture

Issue summary: View changes

Added a WCAG level-A issue - #3024184: Make the tabbing order match the visual reading order in MediaLibraryWidget. This has a patch to fix the problem, but it still needs a bit of CSS too.

andrewmacpherson’s picture

Issue summary: View changes

Adding #3023966: Remove unnecessary title attribute from show-row-weights button. as a nice-to-have. That issue is mainly about tabledrag, but the media library widget has a custom version of the show-weights button.

What's the "questionable" category for here? Maybe it belongs in there.

phenaproxima’s picture

Issue summary: View changes
phenaproxima’s picture

Issue summary: View changes

Removing #2987924: Define an API for finding media types based on an arbitrary value from the IS, as it is now closed for good since it was based on outdated assumptions.

phenaproxima’s picture

Issue summary: View changes

Also updating the ones that are done.

seanb’s picture

Issue summary: View changes

Added new issues.

andrewmacpherson’s picture

andrewmacpherson’s picture

dww’s picture

Issue summary: View changes

Added #3033442: Use 24 items per page for better responsive grid behavior as a could-have. Simple and small, makes for nicer responsive grid behavior.

phenaproxima’s picture

Issue summary: View changes

Added a few should-have UX issues to the roadmap.

andrewmacpherson’s picture

Issue summary: View changes

Adding #2973140: Convey AJAX progress messages to assistive technology. as a should-have.

The issue isn't specific to Media Library, however there is a LOT of AJAX going on in in the MediaLibraryWidget. By my count there are at least 3 AJAX behaviours there which can benefit from this: changing tab, changing filters, changing to grid or table.

andrewmacpherson’s picture

Issue summary: View changes

Tentatively adding a must-have: #2805219: Some dialogs do not receive focus when opened. This bug isn't actually media library's fault, and it affects dialogs elsewhere. So we can change the status if you like.

We have dialogs in various places in our admin UI, but prior to media library all the instances form part of a site builder task. I asked on Slack, and we believe MediaLibraryWidget is the first use of a dialog as part of a content editor task. (I'm not counting dialogs from CKeditor, as those are a different implementation).

My reason for marking it as a must-have comes down to our value of "prioritize for impact". Content editors outnumber site builders. In a large organization, there can be hundreds or thousands of editors, and a mere handful of site builders. Many users of company intranets may not even know what Drupal is. Smaller organizations may have sites built by agencies, where the site builders are all in the agency, and no-one in the client organization has encountered a Drupal dialog before. The point is the audience for our dialogs is about to increase, and MediaLibraryWidget is affected by this bug, so it has become more important to fix.

andrewmacpherson’s picture

We've been doing more accessibility review, and fleshing out #2988431: [Meta] Accessibility plan for Media Library Widget. That issue is already mentioned in the must-haves here. There are many accessibility issues arising from the design updates in #3019150: Update/improve mockups and designs for the media library, notably the tabs in the MediaLibrayWidget dialog. Now the accessibility plan also has some child issues of it's own, which need further triage into must/should/could. I'll bring those over here soon.

andrewmacpherson’s picture

Issue summary: View changes
seanb’s picture

andrewmacpherson’s picture

andrewmacpherson’s picture

Issue summary: View changes

a11y triage - I'd like to treat #3016807: Improve refocus on submit buttons of Media Library Widget modals as a must have. Without that, it's a very disorientating for keyboard users and screen reader users.
It's not really addressed by WCAG though.

andrewmacpherson’s picture

Issue summary: View changes

During the UX meeting today we discussed an awkward chicken-and-egg problem with #2981044-64: Unify the grid/table views of the media library where we need to fix a level-A WCAG issue, but we have to do it with a template override in Seven (or Classy), and we can't add a template to a core theme until after we have marked media library as a stable module.

So between the product managers (@webchick + Gabor), the media leads (@phenaproxima and @seanb), and myself, we have agreed a special handling of the accessibility gate.

  • We can mark media library as stable, knowing it has a WCAG level-A problem, so long as there is a feasible follow-up issue lined up to address this soon after.
  • The follow-up will be treated as a release blocker for the minor version of Drupal core as a whole.
  • Ideally the follow-up should have a working patch ready to go straight after we mark media library as stable, so we minimize the chance of a gotcha we didn't see coming.

Adding a note about that in the IS.

andrewmacpherson’s picture

phenaproxima’s picture

Issue summary: View changes

#2964790: Move formatting code in TimestampAgoFormatter into DateFormatter refers to code which no longer exists (if it ever did) in Media Library. I think this issue arose from an older generation of the design for the Media Library, which displayed creation dates in the grid of media items. Dates were removed from the UI long ago, due to clutter, so that issue no longer needs to be part of this roadmap. I'm removing it.

phenaproxima’s picture

Issue summary: View changes

The bug that #2989503: Add tests to prove that the media library widget works when target_bundles is NULL is testing for was inadvertently fixed in #3020716: Add vertical tabs style menu to media library, so I'm going to de-escalate it to "should-have" priority.

phenaproxima’s picture

Issue summary: View changes

Moving a couple of issues into the "done" list. :)

phenaproxima’s picture

seanb’s picture

Issue summary: View changes

Adding some new issues that were created.

seanb’s picture

Issue summary: View changes

Added some more follow ups and re-ordered the must haves. Also added a group of issues that are blocked on the module becoming stable.

phenaproxima’s picture

phenaproxima’s picture

phenaproxima’s picture

webchick’s picture

^ That officially marks Media Library "UI complete" for 8.7!! If you haven't given it a whirl in awhile, please do! (Clone from Git, or wait until 8.7.0-alpha2/beta1).

webchick’s picture

StatusFileSize
new3.39 MB

Here's a demo video by @seanB showing off the AMAZING progress!

Christopher Riley’s picture

So can we assume that this will be available in 8.7 when released?

phenaproxima’s picture

@Christopher Riley: In a word, yes. Everything in the demo video will be in Drupal 8.7.0 alpha2 and beyond.

webchick’s picture

Yep, though note that the module is still experimental and not yet stable... targeting that for 8.8.

phenaproxima’s picture

Issue summary: View changes

#3019150: Update/improve mockups and designs for the media library is now marked Fixed, so I'm moving it into the "Done" list.

seanb’s picture

Issue summary: View changes

Removed #2113931: File Field design update: Upload field. from the must have list. While it is important for the media library, it is not actually solved in the media library module, and can not be a stable blocker imho.

Added #3020907: Avoid horizontal scrollbar in media library dialog when using small viewports to the list of fixed items. This has been solved in #2981044: Unify the grid/table views of the media library.

Removed #2805219: Some dialogs do not receive focus when opened from the list. This has been solved in #3035316: ‘Add media’ in MediaLibraryWidget should be a button, not a link for the media library and the solution has been added to the issue to hopefully help that move forward.

webchick’s picture

I guess the issue with #2113931: File Field design update: Upload field. being removed from the "must-have" list is that until that's done, the media library does not match the designs. And it's not a little quibbly on-the-margin thing in the designs (like, say, the "X of 5 uploaded" bit) but THE interface through which one uploads new media. :\

effulgentsia’s picture

until that's done, the media library does not match the designs...THE interface through which one uploads new media

That's true if you interpret the media library to include the interface through which one uploads new media. However, media_library.info.yml says:

Enhances the media list with additional features to more easily find and use existing media items.

Which does not include uploading new items.

It's a product management decision as to whether adding new media is sufficiently part of or adjacent to the media library to warrant keeping the module experimental until that's done. But from my perspective, I think it's reasonable to call it stable if everything related to the scope of "finding and using existing media items" is stable.

webchick’s picture

StatusFileSize
new1 MB

Well, uploading new things is included in the Media Library directly these days; here's a screenshot from the above video:

Upload files or select existing media in same interface

We probably need a follow-up to change the module description (and hook_help()?) accordingly.

webchick’s picture

webchick’s picture

As to whether it's worth blocking... I'm not sure. If it was the only issue remaining, I can see the logic for letting it through as stable, since it's not introducing "new" ugliness. But OTOH, the drop zone is a significant part of the new designs, so seems kinda like shipping a three-wheeled car without it. :\

seanb’s picture

Issue summary: View changes
seanb’s picture

Issue summary: View changes
seanb’s picture

seanb’s picture

Issue summary: View changes

Added the issues related to implementing #2801307: [META] Support WYSIWYG embedding of media entities.
Moved #3023809: Add a selection overview to the media library widget modal to the list of should haves, since this came up a couple of times during the UX and A11Y reviews.
Also added #2113931: File Field design update: Upload field. back to the list of must haves. Even though this is not something that is solved in the media library module, we agree that that having this makes a big difference.

seanb’s picture

Issue summary: View changes
phenaproxima’s picture

phenaproxima’s picture

chandeepkhosa’s picture

Issue summary: View changes

I moved 3 completed issues that were crossed out into the `Done` section from other sections to help readability of what's left to do.

phenaproxima’s picture

phenaproxima’s picture

Issue summary: View changes

Adding #3060603: Live preview is broken when editing the media_library view as a must-have stable blocker. My justification for this is that part of Media Library's flexibility is the fact that it's built around a view, and live preview is very important for customizing that view. If live preview is broken, Media Library is automatically much harder to configure.

phenaproxima’s picture

seanb’s picture

phenaproxima’s picture

Issue summary: View changes
phenaproxima’s picture

Issue summary: View changes

Sorry -- accidentally moved that to the wrong list.

wim leers’s picture

Issue summary: View changes

Removing #3019201: Improve UX of the 'Remote video' media type which is now obsolete. Also removing some duplicates.

phenaproxima’s picture

Issue summary: View changes

Removed #2985168: [PP-1] Allow media items to be edited in a modal when using the field widget from the roadmap after wontfixing it following discussion with @seanB and @xjm at Drupal Dev Days Cluj.

phenaproxima’s picture

phenaproxima’s picture

Issue summary: View changes

Moving #2969678: Integrate Media Library with Content Moderation to the must-have list after discussion with @xjm.

phenaproxima’s picture

Issue summary: View changes

Removing #2973124: Provide better context in accessible names of EntityOperation views plugin drop-button operations from the roadmap. The media library view/widget itself, which is the most author-facing part of the Media system, is not affected by this issue because it does not expose any dropbuttons, and this is a wider problem in core. I'm moving it to the Media Initiative roadmap instead, because it affects that aspect of things much more severely.

phenaproxima’s picture

Issue summary: View changes

Moving to #3003150: Media library causes validation errors when it is used in a required field of a nested form to should-have list per discussion with @xjm.

EDIT: Also removed the item about adding "carousels for multi-value wizardmagick" because, as we recall it, the UX team did not like this idea, and it can certainly be done in contrib.

phenaproxima’s picture

Issue summary: View changes

Following a discussion with @seanB and @xjm, I need to update this roadmap with issues that have been created since late March, 2019, which is the last time our queue was properly triaged.

I am adding:

phenaproxima’s picture

phenaproxima’s picture

phenaproxima’s picture

seanb’s picture

Issue summary: View changes

Added the A11Y must-haves to the roadmap for better visibility of the remaining work.

phenaproxima’s picture

gábor hojtsy’s picture

I just had a quick call with @phenaproxima and discussed what he raised earlier in chat as well. Unfortunately #2113931: File Field design update: Upload field. turned out to be a no-go in terms of implementing the widget as designed. Unfortunately it needs to go back to the drawing board in terms of accessible markup and visual design that goes with it so it looks unlikely to be ready soon. It is my understanding that this is a massive UI improvement but it does not degrade accessibility or other requirements to not have this feature update in place. So while I would really love to have this UI improvement in, it sounds unrealistic to hold the stability of the whole of media library to this pre-existing UI component issue. That said, I support moving the successors of that issue to the top of the should have list from the must have list.

phenaproxima’s picture

Issue summary: View changes

Thanks, Gábor. Fixing the issue summary as agreed.

phenaproxima’s picture

Issue summary: View changes

Added two more must-have WYSIWYG issues to the IS.

phenaproxima’s picture

Issue summary: View changes

Removing #3039829: Remove link to media item from media library view. from the should-have list; it is a must-have and is listed as such.

phenaproxima’s picture

Issue summary: View changes

Adding #3059955: It is possible to overflow the number of items allowed in Media Library to the should-have list, since it is a major UX bug; adding #3065677: Create a media_library form element to the could-have list, since it'd be a lovely feature for DX.

seanb’s picture

Issue summary: View changes

We landed #3039829: Remove link to media item from media library view. so that means the meta issue #2988431: [Meta] Accessibility plan for Media Library Widget now only contains should-haves and could-haves.

andrewmacpherson’s picture

#184:
The a11y plan still has some points listed as "needs triage". Now that the a11y is much further along, it would be good to do another triage pass over that list, just in case we missed any must-haves.

phenaproxima’s picture

Issue summary: View changes

#2940029: Add an input filter to display embedded Media entities landed; that's one step closer to WYSIWYG support in core!

phenaproxima’s picture

phenaproxima’s picture

Issue summary: View changes

Adjusting the issues linked the IS per product manager feedback in #2801307-94: [META] Support WYSIWYG embedding of media entities.

phenaproxima’s picture

Issue summary: View changes
oknate’s picture

phenaproxima’s picture

phenaproxima’s picture

chris matthews’s picture

Is there any chance that #2998713: Add a media source for remotely hosted files could be categorized as a "Could-have" or "Should-have" issue?

effulgentsia’s picture

Issue summary: View changes

#3063216: Inaccessible Media entities still have rows generated for them in the Media Library view, containing form wrapper markup *and* the media label no longer blocks #2969678: Integrate Media Library with Content Moderation. Therefore moving it from the "Must-have" to "Questionable".

AFAICT, #3074608: Optionally allow choosing a view mode for embedded media in EditorMediaDialog is now the last child of #2801307: [META] Support WYSIWYG embedding of media entities that needs to block Media Library from being stable, so simplifying this issue's must-have list to just reference that one and not the meta.

effulgentsia’s picture

Issue summary: View changes

Trying #196 again. I copy/pasted the wrong issue numbers in the IS, so reverted that and trying again.

effulgentsia’s picture

Issue summary: View changes

Per discussion with @webchick, updating the first must-have to an either/or.

xjm’s picture

Issue summary: View changes

I moved #3063216: Inaccessible Media entities still have rows generated for them in the Media Library view, containing form wrapper markup *and* the media label to the should-haves. Even if it's no longer blocking a must-have, it's still an ugly, user-confusing bug.

If we could see some more of the accessibility should-haves fixed, that would be good -- a long list of unresolved major issues is "significantly increasing technical debt". I suggested reaching out to accessibility contributors for top priorities or low-hanging fruit that would be particularly helpful.

rainbreaw’s picture

@xjm, I've reviewed everything in this and the #2988431 Accessibility Plan, and my thoughts regarding the priority of remaining accessibility concerns are:

Top priority:

Can be demoted somewhat if needed:

These appear to no longer be an issue:

Unsure:

For this one, I'm unsure if it is really something that should be done, or at the very least it may need more deliberation as to how it will be implemented.

It depends:

Drag & Drop

While this is a should have from an overall user expectation standpoint, from an accessibility standpoint, in my mind, it isn’t. However, if the drag and drop element is implemented, then making sure that it is accessible to non-sighted and keyboard-only users is a must-have, not a should-have. In this case, this can simply mean bypassing the drag and drop interaction points entirely and moving a keyboard only user to the clickable upload button.

gábor hojtsy’s picture

#3081587: Multilingual content is shown double in the media library view was found by @webchick and @shaal, it would be really odd to mark media library stable without a way to resolve that, since even Umami could not use it yet.

andrewmacpherson’s picture

#200

Can be demoted somewhat if needed:
#3037781: Accessibility problem with invisible buttons in AJAX dialogs

It's already listed on the media library accessibility plan as a could-have. I don't think it can be demoted any lower, short of ignoring it.

shaal’s picture

xjm’s picture

Issue summary: View changes

I added #3081526: Add announcement after clicking 'Save and select' in the media library. to the should-have list based on #200. I also moved that and #2973140: Convey AJAX progress messages to assistive technology. to the top of the should-have list with a note.

Thanks @rainbreaw and @andrewmacpherson!

xjm’s picture

This morning I went through all the Media Library issues that are new since we last triaged the queue back in June. Of those issues, the following don't appear yet on the roadmap above and need to be triaged (mostly followups to the CKEditor work):

Data integrity and upgrade path

Public or internal APIs and BC

Performance and cacheability

Accessibility

Usability

Other

I've not read through all the above issues as yet, just wanted to document that these are what's not already been triaged. Many are probably just could-haves.

Edit: Sorted the issues into some categories.

xjm’s picture

Issue summary: View changes

I filed #3082690: Mark Media Library as a stable core module for the final step of actually marking the module stable once the must-haves are done. I've also added #3072319: Determine the scope of default styling for embedded media (what belongs in Classy, Stable, etc.?) to the must-have list since this directly affects what that patch will actually contain. These things don't actually change the scope of the roadmap in any way, but best not to forget about them until the last minute. :)

xjm’s picture

Issue summary: View changes

Shuffling the IS to clarify the "todo after module is stable" stuff. Those issues should have RTBC-like patches available and probably should all be committed together as part of the issue to mark the module stable (rather than as followups).

xjm’s picture

Issue summary: View changes

Adding a "needs triage" section as per #205.

I also notice #2983179: [META] Implement stricter access checking for the media library was reopened the day it was marked fixed, so moving that one back to the "needs triage" section as well.

xjm’s picture

Issue summary: View changes

Sorting the should-haves so the list is less overwhelming, and also moving #2981105: Media Library should not modify the media view to needing triage as an upgrade path issue.

xjm’s picture

Issue summary: View changes

Moving one un-triaged accessibility issue up to the should-haves, and recategorizing another that's actually more of a generic UX issue. (There is, of course, overlap.)

xjm’s picture

Issue summary: View changes

Moving a wontfixed issue to the end, and also adding an issue that was reopened for update hook numbering to the ones we need to triage.

phenaproxima’s picture

bnjmnm’s picture

Issue summary: View changes

Adding #3037781: Accessibility problem with invisible buttons in AJAX dialogs to the accessibility issues. Currently the dialogs have invisible submit buttons that can still be accessed via tab navigation. This is in could-haves of #2988431: [Meta] Accessibility plan for Media Library Widget, but it becomes more of a problem when there are multiple submit buttons such as "Save and Select" + "Save and Insert", which causes two phantom tabstops. Plus, it's (probably?) an easy fix.

xjm’s picture

Issue summary: View changes

Adding #3063216: Inaccessible Media entities still have rows generated for them in the Media Library view, containing form wrapper markup *and* the media label itself back to the roadmap for further triage of the security requirements, I've been told #2969678: Integrate Media Library with Content Moderation is intended to mitigate some of this, so the patches need to be tested together to endure there is no information disclosure regardless of whether or not Content Moderation is enabled. Thanks

phenaproxima’s picture

Issue summary: View changes

#3035331: Improve keyboard focus behaviour of vertical tabs in MediaLibraryWidget is in; removing from the should-have accessibility list.

xjm’s picture

Issue summary: View changes

Adding some link fragments to the IS.

xjm’s picture

Issue summary: View changes
xjm’s picture

Issue summary: View changes
xjm’s picture

Issue summary: View changes

@phenaproxima and I discussed #2981105: Media Library should not modify the media view and agreed it is a must-have due to the impact on site data integrity and upgrade paths.

xjm’s picture

Issue summary: View changes
xjm’s picture

Issue summary: View changes
xjm’s picture

Issue summary: View changes

Agreed with #3074863: Improve the UX of captioning in CKEditor @phenaproxima that this issue is a could-have, because the behavior is also the same for existing issue buttons and we should improve the interaction and UX of both!

xjm’s picture

Issue summary: View changes

We made #3074859: Add a button to remove an embedded media item from the editor a could-have because it is a feature request and we are not actually sure whether it's the correct solution. Good to research after stable if needed.

xjm’s picture

Issue summary: View changes

We made #3072323: Add consistent default margins for left- or right-aligned widgets in CKEditor a could-have since it is a refinement to the presentation of CKEditor embeds and can be improved after stable.

xjm’s picture

Issue summary: View changes
xjm’s picture

Issue summary: View changes

@phenaproxima and I moved #3072317: CKEditor embedded media previews do not render with attached assets to could-have (it might be a wontfix).

xjm’s picture

Issue summary: View changes

#3071713: Make error messages for embedded media themeable seems like a feature request that can be done after stable, so @phenaproxima and I moved it to could-have.

Thanks everyone!

xjm’s picture

Issue summary: View changes
effulgentsia’s picture

effulgentsia’s picture

Issue summary: View changes

#235 only did a copy, not a move, so this does the deletion.

phenaproxima’s picture

Issue summary: View changes

Moving #3075593-6: Allow MediaEmbed filter to use data-langcode to set media translation to the could-have list per Gábor's feedback. It feels like a feature request that falls outside of the 80% use case and can introduce substantial additional complexity.

phenaproxima’s picture

Issue summary: View changes

#2969678: Integrate Media Library with Content Moderation landed, and the requested follow-up for #3039829: Remove link to media item from media library view. is filed and RTBC, so I'm moving these issues to the "done" list.

phenaproxima’s picture

phenaproxima’s picture

Issue summary: View changes

#3059955: It is possible to overflow the number of items allowed in Media Library was promoted a critical must-have issue, so I'm removing it from the "should-have" list.

phenaproxima’s picture

Issue summary: View changes

Whoops, sorry! Moved the wrong thing.

xjm’s picture

Issue summary: View changes

I moved #3076773: Edit Media button within WYSIWYG should include media label for screen readers to should-have based on discussion with @rainbreaw and @andrewmacpherson. Thanks for the reviews!

Similarly, given @andrewmacpherson's feedback on #3083090: In the media library, announce the type of media being selected, I am moving that one to could-have.

xjm’s picture

Issue summary: View changes

Oh and moving CM to fixed!

xjm’s picture

Issue summary: View changes

Also moving down a few more fixed issues.

xjm’s picture

Issue summary: View changes

I moved #3073734: Immediately delete a media's file when pressing 'Remove' in the media creation modal to must-have based on Adam's explanation. Fortunately it's already RTBC -- Adam seems to have anticipated my train of thought there. :)

xjm’s picture

Issue summary: View changes

Based on Adam's update in #3073535: Allow only a subset of the media library to be exposed to CKEditor, that issue can be considered a could-have and a feature request or usability improvement. Moving accordingly.

geek-merlin’s picture

AFAIK, media library is as agnostic to attachments as entity_embed. So #3084312: Make (embedded entities') JS work inside CKEditor and #3084322: Leverage (server-side-ajax) JS logic for client-side AJAX may be useful here too.

wim leers’s picture

#247: there are very very strong and already documented reasons that should not be done.

geek-merlin’s picture

@wim: That's harsh without any pointer for me to make sense of. Imho you strongly advocated just that in #2882866-8: Provide a preview display setting for use in WYSIWYG editors, improves authoring ergonomics "Then let's just make that JS load inside CKEditor!" so i put some work into this, now i'm quite disappointed you react like this. Can you give me a pointer to what you mean? I surely don't want to bark up a wrong tree, nor put more work into a misunderstanding.

(Also i surely don't want to distract the 8.8 final sprint, just had the opportunity to work on something that i thought is useful later.)

wim leers’s picture

#250: oh, the issues you linked are newly created by you, the title of the first issue you linked is very close to an issue we fixed & closed months ago. So I thought you were linking to that and ignoring the detailed, long conversation in there. Apologies! 😞
I I see you did comment on that issue last night, but I suspect you haven't read it yet. I replied to your first issue at #3084312-3: Make (embedded entities') JS work inside CKEditor — let's continue the conversation there 😊

Again, my apologies — I confused two issues because your title immediately made me conclude (wrongly, obviously!) that you were just pointing to an issue that I'd already spent countless hours on. A pointer was not necessary … if I hadn't mixed up issues 🙃 Sorry about that!

geek-merlin’s picture

#251: OK, thank you for clarifying that immense misunderstanding., no hard feelings left.
I'll immediately read that issue though...

xjm’s picture

Issue summary: View changes

Adding #3055648: Frequent random fail in \Drupal\Tests\media_library\FunctionalJavascript\MediaLibraryTest to the should-haves. It's not a must-have because it has no impact on production, and the test is equally disruptive for the development process regardless of whether the module is beta or stable.

phenaproxima’s picture

Issue summary: View changes

Per #3072319-16: Determine the scope of default styling for embedded media (what belongs in Classy, Stable, etc.?), that issue is no longer valid and should therefore be removed from the must-have list. Not sure if #3071713: Make error messages for embedded media themeable is now a stable blocker, but it is surely a should-have at this point because, although it is technically a feature request, it has some front-end framework implications. I'll leave the release managers to decide if it is a must-have.

phenaproxima’s picture

Issue summary: View changes

#2981105: Media Library should not modify the media view is a current critical in HEAD and is a must-have stable blocker; removing it from the should-have list.

phenaproxima’s picture

Issue summary: View changes

EDIT: Fixed a mistake I made in the previous comment.

phenaproxima’s picture

phenaproxima’s picture

Issue summary: View changes

#3073734: Immediately delete a media's file when pressing 'Remove' in the media creation modal is in, so removing from the "must-have" list. Another stable blocker bites the dust! (Queue the funky bassline.)

phenaproxima’s picture

Issue summary: View changes
phenaproxima’s picture

Issue summary: View changes

#3073535: Allow only a subset of the media library to be exposed to CKEditor is in. 'Twas only a could-have, but still, a nice feature!

bnjmnm’s picture

Issue summary: View changes

Moved #3062375: Media library item loses focus when hovering over item's title to should-have. Confirmed it is a bug, and fortunately already have a patch for it.

phenaproxima’s picture

Issue summary: View changes

#3034244: Add a cancel or back button to the media library was closed by @webchick; she doesn't think it is relevant anymore, given the work that has gone into Media Library since that issue was filed. So, moving it to the very end of the "done" list. :)

phenaproxima’s picture

Issue summary: View changes

#3037781: Accessibility problem with invisible buttons in AJAX dialogs is in! That list of accessibility should-haves is looking miiiighty slim. :)

wim leers’s picture

wim leers’s picture

wim leers’s picture

Issue summary: View changes
wim leers’s picture

Issue summary: View changes

Following @phenaproxima's example in #263 with #3075593: Allow MediaEmbed filter to use data-langcode to set media translation, which was closed a week ago.

andrewmacpherson’s picture

Issue summary: View changes
phenaproxima’s picture

phenaproxima’s picture

phenaproxima’s picture

Issue summary: View changes
bnjmnm’s picture

Issue summary: View changes
phenaproxima’s picture

Issue summary: View changes

I am sorry to say that due to changes in the direction of #2980769-18: Move Media Library styles into the Seven theme, #3049943: Media library should not use js- prefixed CSS classes for styling has been escalated to a stable blocker.

phenaproxima’s picture

phenaproxima’s picture

Issue summary: View changes

#3049943: Media library should not use js- prefixed CSS classes for styling is now a must-have; removing it from the should-have list.

phenaproxima’s picture

Issue summary: View changes

@alexpott committed #3049943: Media library should not use js- prefixed CSS classes for styling, so that unblocks the remaining must-have front-end issues. 🤪

phenaproxima’s picture

seanb’s picture

phenaproxima’s picture

Issue summary: View changes
phenaproxima’s picture

Issue summary: View changes
phenaproxima’s picture

Issue summary: View changes

Moving #3035994: Add a Media Library views template to Seven theme to change to order of the views header and exposed filters to the "done" list, because it has been merged into #3082690: Mark Media Library as a stable core module.

I'm also removing this bit of info that was originally added by @andrewmacpherson:

IMPORTANT. This one has special handling for the accessibility gate where we mark a stable module with a level-A WCAG focus order failure. See comment #126 in this issue, and comments #64-65 in #2981044: Unify the grid/table views of the media library.

I'm removing it because it is no longer valid. #3035994: Add a Media Library views template to Seven theme to change to order of the views header and exposed filters fixes the WCAG violation, and it's going to be committed at the same time and in the very same patch as the one that will make Media Library a stable module. So we are not "mark[ing] a stable module with a level-A WCAG focus order failure"; we are fixing the failure at the same time as we commit the module.

phenaproxima’s picture

phenaproxima’s picture

Issue summary: View changes

Adding #3087206: Perform further Media Library documentation polishing as a should-have, per @webchick's request.

phenaproxima’s picture

phenaproxima’s picture

Issue summary: View changes

And then...

...and then, there was One. Stable. Blocker. Left.

Moving #2964789: Document the Media Library module to the "done" list.

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.

phenaproxima’s picture

Issue summary: View changes

#2980769: Move Media Library styles into the Seven theme is done.

So...there are no more stable blockers.

Let's do this.

rainbreaw’s picture

Issue summary: View changes

Informational: I've been creating issues based on the NVDA walkthrough we did for Media Library, which can be seen in-context with notes linked from the agenda for the walkthrough: https://docs.google.com/document/d/1cvlrRb2sedV_jajLkw0YsJyxMxJ8HoqqFyvk...

I've been marking these as 8.9.x-dev, as these are not stable blockers.

phenaproxima’s picture

Issue summary: View changes

Restoring accidentally blown-away changes to the issue summary.

xjm’s picture

Issue summary: View changes
xjm’s picture

Issue summary: View changes

Moved #3073901: Determine an upgrade path from CKEditor image button to media library to #2825215: Media initiative: Roadmap as a standard profile blocker/upgrade path issue related to the file/image migration generally.

xjm’s picture

Issue summary: View changes

Belatedly moving all the "triage needed" issues to should-haves based on the feedback that was previously provided.

xjm’s picture

Issue summary: View changes
xjm’s picture

Issue summary: View changes

Added the Media Library issues filed since the last triage, for what should hopefully 🤞be the final triage. (Roughly half are the accessibility issues from the recent walkthrough and subsequent testing.)

xjm’s picture

The following issues already listed as "should-have" are filed as normal issues:

For the most part, if something is considered a "should-have" prior to marking the module stable, that means it's probably major. So, for the above, we should evaluate whether each issue should be promoted to major, or whether it's no big deal and can actually be demoted to could-have. (Having issue priority set correctly is one of the things we look for when evaluating a feature's technical debt prior to marking it stable.)

Thanks!

oknate’s picture

Here's a minor issue that affects the media library post update comment: #3087184: Update.php comments display improperly due to poor usage of str_replace.

This comment:

/**
 * Sets /admin/content/media to the table display of the 'media' view.
 */

Gets converted to this when displayed to the user:
8705 - Sets admincontentmedia to the table display of the 'media' view.

andrewmacpherson’s picture

Following #289 - I also looked through the list of issues arising from the NVDA walkthrough. I agree with Rain that most of these are not stable blockers.

However there are two issues which I would class as major, because they both relate to WCAG "Error Identification" at level A.

Typically we've been treating level-A as major/must-have, and level-AA as normal/should-have. I'm aware that we are SO close to marking Media Library as a stable module, and these were only filed at the eleventh hour prior to alpha week. Treating them as must-have stable blockers will throw a serious spanner in the works (and will be very sad).

The release managers have previously indicated that accessibility bugs are eligible for inclusion after marking a core D8.y.z-alpha release. I'm open to treating these as strong should-haves, if the initiative team can keep working on them up to RC, say.

Note that the scenarios for these two bugs are similar; I suspect they may both need the same fix.

@cboyden's team should get an issue credit when we mark it as stable, for the screen reader walkthrough testing they did. (TODO, find out if the others have d.o accounts.)

phenaproxima’s picture

The release managers have previously indicated that accessibility bugs are eligible for inclusion after marking a core D8.y.z-alpha release. I'm open to treating these as strong should-haves, if the initiative team can keep working on them up to RC, say.

Note that the scenarios for these two bugs are similar; I suspect they may both need the same fix.

I can't speak for the rest of the initiative team, but I'm certainly willing to work on these (and coordinate work on them) for fixing during alpha and/or beta. They also seem to me like they might be the same issue, and possibly even a pre-existing condition in core, so I agree that they should not block stability.

andrewmacpherson’s picture

Issue summary: View changes

I would relate these two "error identification" WCAG level-A issues in #300 as higher priority than the ones that were previously marked as top priority should-haves (which are an advisory technique for level AA "status messages").

cboyden’s picture

@andrewmacpherson, team members who worked on the walkthrough and have drupal.org accounts are myself and @annagaz.

xjm credited annagaz.

xjm’s picture

Adding some (incomplete) issue credits, to make sure the accessibility reviewers are credited for helping to develop the roadmap as per #303.

phenaproxima’s picture

phenaproxima’s picture

Issue summary: View changes

Removing #3085532: Media Library Always allows creation of new references from the triage list, because it is a duplicate of an existing issue (already in the roadmap) and has been closed as such.

phenaproxima’s picture

Issue summary: View changes

Removing #3085254: [PP-1] All displays of the administrative media overview should be in a single view from the triage list. I have closed it as outdated, as the problem which originally gave rise to it has been resolved cleanly in another issue.

phenaproxima’s picture

Issue summary: View changes

Removing #3085545: title attribute still not added to oEmbed iframe from the triage list because it has nothing to do with Media Library. The feature and code in question lives entirely in the Media module and always has.

phenaproxima’s picture

Issue summary: View changes

Removing #3087613: cannot use Enter when doing quick-edit on a media-field from the triage list. As far as I can tell from the steps to reproduce and from the demo video, it has nothing to do with the media library.

phenaproxima’s picture

Issue summary: View changes

Removing #3082036: Move functionality of the Meta position module into core from the triage list. As far as I can tell, it is a feature request that has nothing specifically to do with the media library.

phenaproxima’s picture

phenaproxima’s picture

phenaproxima’s picture

Issue summary: View changes
phenaproxima’s picture

Issue summary: View changes

Removing #3034243: Improve selection text in Media Library from the should-have list, and replacing it with #3087389: When selecting media to add through the media library modal, the # of # selected text is contextually confusing, especially if read by a screen reader from the triage list. The latter issue has a more detailed summary that covers the accessibility implications of the problem, and neither issue has had much work done on it.

xjm’s picture

@phenaproxima and I just did a quick review of the issues filed in the past few weeks. Here is a rundown:

We think these accessibility issues are major:

These issues are more normal/could-have:

Most of the non-accessibility issues left are also normal/could have:

These issues are feature requests:

Let me know if I have the priorities set incorrectly on any of those accessibility issues. Thanks!

Edit: Forgot to mention, I asked for #3087126: Media Library "select all" checkbox does not have proper margin in RTL styling to be added to #3082690: Mark Media Library as a stable core module.

xjm’s picture

I also read over the issues @phenaproxima filtered out in the previous comments and agree in each case. Thank you!!

phenaproxima’s picture

Responding to #297, and three more:

xjm’s picture

Issue summary: View changes

Thanks @phenaproxima. I promoted the majors and sorted the normals down to could-have.

dww’s picture

Issue summary: View changes

#3085908: Media library thumbnails are blurry/skewed in IE11 was reverted, moved back to 'Should have'.

phenaproxima’s picture

phenaproxima’s picture

Issue summary: View changes

Removing #3071682: The oembed Resource value object should be more permissive for NULL dimensions from the roadmap. It is not related to Media Library at all; the relevant code lives in Media and always has.

phenaproxima’s picture

Issue summary: View changes

Removing #3087184: Update.php comments display improperly due to poor usage of str_replace from the roadmap. Although it is a minor nuisance and is exposed by one of Media Library's update functions, it is a bug in the update system and not specific to Media Library at all.

andrewmacpherson’s picture

Issue summary: View changes

#3084011: The source of alt text in embedded image media is not clear has major priority, but was un-triaged here. Discussed it with @phenaproxima.

  1. There are feasible proposals for configurable policy and/or an upgrade path, so this isn't a blocker for stabilizing media_library. I'm classing it as a could-have here.
  2. We agree it's still major, and a must-have before enabling media_library in Standard profile. I've added it to #2825215: Media initiative: Roadmap.
phenaproxima’s picture

Issue summary: View changes

#3084011: The source of alt text in embedded image media is not clear has the "major" priority, so it is a should-have. :)

xjm’s picture

Issue summary: View changes

Moving a couple accessibility majors up from the triage section as per #317.

xjm’s picture

Issue summary: View changes

Also moving around the rest of the triaged a11y issues as per #317 and subsequent comments.

xjm’s picture

Issue summary: View changes

Trying to be parsimonius with my IS update comments because we're about to hit two pages again.... I'm updating the IS as per #317 still.

oknate’s picture

Issue summary: View changes
oknate’s picture

Can we get this issue triaged into the IS list? #3092795: [regression] Restore styling for embedded media edit button in Seven theme

If we can't get this into 8.8, it would be good to add it to a release note or something so people don't bang their heads against the wall wondering where the pencil went.

chris burge’s picture

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.

wim leers’s picture

I'm concerned that lots of people are adding lots of 1–5% desired features (unrelated to accessibility/security/performance!) and hence blocking this from getting Media enabled by default in Standard.

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.

phenaproxima’s picture

Status: Active » Closed (outdated)

Media Library has been a stable core module since Drupal 8.8, and therefore I think it's time to close out this issue in favor of #2825215: Media initiative: Roadmap. I've moved all the outstanding issues in this issue's summary to that meta.