Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Edit Gallery from Media Library modal #21413

Closed
noisysocks opened this issue Apr 6, 2020 · 9 comments
Closed

Remove Edit Gallery from Media Library modal #21413

noisysocks opened this issue Apr 6, 2020 · 9 comments
Assignees
Labels
[Block] Gallery Affects the Gallery Block - used to display groups of images [Feature] Media Anything that impacts the experience of managing media Needs Dev Ready for, and needs developer efforts [Type] Bug An existing feature does not function as intended

Comments

@noisysocks
Copy link
Member

noisysocks commented Apr 6, 2020

Describe the bug

Users are able to edit a gallery from the modal that appears when one clicks on Media Library in a Gallery block. This is confusing, though, as the image captions in this modal differ from the image captions in the block. Having Edit Gallery in the modal is unnecessary as galleries can be edited directly from within the block. We should remove the Edit Gallery button. See #8310 for more context.

To reproduce

  1. Insert a Gallery block.
  2. Upload a few images to the gallery.
  3. Add a caption to one or more images.
  4. Click Media Library.
  5. Click Edit Gallery.

Note that the image captions that appear in the modal differ from the image captions that appear in the block.

Expected behavior

There should not be a Edit Gallery button in the modal.

Screenshots

gallery

@noisysocks noisysocks changed the title Remove 'Edit Gallery Remove Edit Gallery from Media Library modal Apr 6, 2020
@noisysocks noisysocks added [Block] Gallery Affects the Gallery Block - used to display groups of images [Feature] Media Anything that impacts the experience of managing media [Type] Bug An existing feature does not function as intended Needs Dev Ready for, and needs developer efforts labels Apr 6, 2020
@jessie-ross
Copy link
Contributor

@noisysocks, is it ok if I tackle this one?

@paaljoachim
Copy link
Contributor

Check out this issue:
#21247

@noisysocks
Copy link
Member Author

noisysocks commented Apr 7, 2020

@noisysocks, is it ok if I tackle this one?

Go for it! 💪 I'll assign you so that nobody else accidentally starts working on it. Let me know if you can no longer work on this and would like to be unassigned. And, of course, please drop into #core-editor in WordPress Slack if you have any questions or need help.

Check out this issue:
#21247

This will still be an issue if #21247 is implemented because we'll still have the Media Library button.

@jessie-ross
Copy link
Contributor

I have taken a look at this.

The context seems to be that the modal is a Wordpress tool from pre-Gutenberg, and is getting phased out for a purely block editing tool as per #21247 . It provides both gallery editing as well as media-library capabilities and we will be removing the gallery editing.

I have traced the media library button through the code and I have found a way to isolate the modal as used only by gallery:

const getGalleryDetailsMediaFrame = () => {
/**
* Custom gallery details frame.
*
* @see https://github.com/xwp/wp-core-media-widgets/blob/905edbccfc2a623b73a93dac803c5335519d7837/wp-admin/js/widgets/media-gallery-widget.js
* @class GalleryDetailsMediaFrame
* @class
*/
return wp.media.view.MediaFrame.Post.extend( {

wp.media.view.MediaFrame.Post is used in other places particularly the classic editor, so it makes sense to alter its behaviour using the extension of it above.

Design-wise, I looks like it should work to just remove the "Edit Gallery" menu item, and as per #8310 it seems like it won't impact existing user experience.

I will submit a PR shortly.

Possible complications:

  • I have not yet looked at the native side of things, I am not sure if I need to.
  • MediaUpload goes through an extensible filter, I haven't looked into this enough but it doesn't look like it should be an issue.

@jessie-ross
Copy link
Contributor

While testing this I have found that the edit image feature currently isn't functional:

Screen Shot 2020-04-09 at 10 20 52 pm

@jchornenky
Copy link

How are you supposed to swap or add images to a gallery if this feature is removed?

@padams
Copy link

padams commented Aug 16, 2020

Please do not remove the edit link. It is currently the only way to edit the caption (or other media meta-data ) for an image
"globally" without having to hunt for the image in the media library. Also editing via the modal allows for drag and drop re-ordering of images which far faster than clicking the arrow button on images in the Gutenberg gallery.

@phil-sola
Copy link

I second the comments above. Please do not remove the edit gallery link on the left. This is an incredibly helpful feature. Especially for Block developers who may want to create their own enhanced gallery block.

MediaPlaceholder component offers the desired functionality whereas MediaUpload seems to be the dated (pre-gutenberg) version of the same thing, without the edit gallery link. I have tried both from a UX perspective and it is far more confusing not being able to reorder or edit the images already selected to the gallery; and having to completely resubmit the images each time, than it is simply having the option there.

It makes no sense to remove this from the newer component. Surely the issue here is that the captions should sync up if they are a feature? Not simply remove another feature because this one doesn't work.

@mrfoxtalbot
Copy link

The link to the Media Library that used to be visible right under the gallery block has now been removed, so there is no way to access the Media Library directly anymore. I am going to mark this as resolved but please feel free to reopen if necessary, @noisysocks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Gallery Affects the Gallery Block - used to display groups of images [Feature] Media Anything that impacts the experience of managing media Needs Dev Ready for, and needs developer efforts [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants