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

Gallery block: Add images size selector #18581

Merged
merged 8 commits into from Dec 16, 2019
Merged

Conversation

mmtr
Copy link
Contributor

@mmtr mmtr commented Nov 18, 2019

Description

Add an image size selector to the gallery block that allows users to choose the size of the images. It defaults to the large size.

Fixes #1450

How has this been tested?

Manually, following the steps below:

  • Insert a gallery block and add some images.
  • Verify there is a new images size selector that defaults to "Large".
  • Choose a different size.
  • Verify the editor loads the images in the selected size.
  • Publish the post and verify the frontend loads the images in the selected size.
  • Open an existing post containing a gallery block and verify images in large size are still loaded.

Screenshots

Screen Shot 2019-11-18 at 17 02 40

Types of changes

Enhancement.

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR. .

@mmtr mmtr added the [Block] Gallery Affects the Gallery Block - used to display groups of images label Nov 18, 2019
@mmtr mmtr self-assigned this Nov 18, 2019
@mmtr mmtr force-pushed the update/gallery-block-image-size branch 2 times, most recently from 9f88bfb to 9042e51 Compare November 29, 2019 14:49
Copy link
Member

@jorgefilipecosta jorgefilipecosta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @mmtr, thank you for this PR. It worked great on my tests. I just left a comment related to the number of network requests we could be making.

packages/block-library/src/gallery/edit.js Show resolved Hide resolved
@mmtr mmtr force-pushed the update/gallery-block-image-size branch from 9042e51 to 231da67 Compare December 6, 2019 13:02
@idea--list
Copy link

Applied these changes on my localhost, seems to pass my manual tests.
This is an awesome PR, fixes a long standing severe issue with GB.
(Also cover and media&text blocks would need this setting)

Copy link
Member

@jorgefilipecosta jorgefilipecosta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worked well on my tests 👍

@mmtr mmtr force-pushed the update/gallery-block-image-size branch from 231da67 to 3c6f371 Compare December 16, 2019 14:37
@mmtr mmtr merged commit 36f8a9d into master Dec 16, 2019
@mmtr mmtr deleted the update/gallery-block-image-size branch December 16, 2019 15:22
@youknowriad youknowriad added this to the Gutenberg 7.2 milestone Jan 6, 2020
@ShareTextures
Copy link

@mmtr I installed Gutenberg 7.2 but I can't see image size selector?

@mmtr
Copy link
Contributor Author

@mmtr I installed Gutenberg 7.2 but I can't see image size selector?

It only shows up when the gallery block contains an image coming from the media library. If the gallery block is empty or contains only images that are just URLs, the selector won't cause any effect and thus is hidden.

Can you verify you are not using the gallery block under one of these scenarios?

@ShareTextures
Copy link

ShareTextures commented Jan 10, 2020

@mmtr I installed Gutenberg 7.2 but I can't see image size selector?

It only shows up when the gallery block contains an image coming from the media library. If the gallery block is empty or contains only images that are just URLs, the selector won't cause any effect and thus is hidden.

Can you verify you are not using the gallery block under one of these scenarios?

It's interesting I tried it another computer and it's show it now. Cookies possible :) Thanks

Edit: It setup as a thumbnail but at the single-post page, it still serving image full size instead of thumbnail. Link

@mmtr
Copy link
Contributor Author

Let's move the discussion to #19556

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Gallery: choosing thumbnail size
5 participants