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 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 self-assigned this Nov 18, 2019
@mmtr mmtr requested review from nerrad and ntwb as code owners Nov 19, 2019
@mmtr mmtr force-pushed the update/gallery-block-image-size branch 2 times, most recently from 9f88bfb to 9042e51 Nov 29, 2019
@youknowriad youknowriad requested a review from nosolosw Dec 2, 2019
Copy link
Member

jorgefilipecosta left a comment

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.

@mmtr mmtr force-pushed the update/gallery-block-image-size branch from 9042e51 to 231da67 Dec 6, 2019
@idea--list

This comment has been minimized.

Copy link

idea--list commented Dec 7, 2019

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 left a comment

Worked well on my tests 👍

@mmtr mmtr force-pushed the update/gallery-block-image-size branch from 231da67 to 3c6f371 Dec 16, 2019
@mmtr mmtr merged commit 36f8a9d into master Dec 16, 2019
2 checks passed
2 checks passed
pull-request-automation
Details
Travis CI - Pull Request Build Passed
Details
@mmtr mmtr deleted the update/gallery-block-image-size branch Dec 16, 2019
@youknowriad youknowriad added this to the Gutenberg 7.2 milestone Jan 6, 2020
@ShareTextures

This comment has been minimized.

Copy link

ShareTextures commented Jan 10, 2020

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

@mmtr

This comment has been minimized.

Copy link
Contributor Author

mmtr 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?

@ShareTextures

This comment has been minimized.

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

This comment has been minimized.

Copy link
Contributor Author

mmtr commented Jan 13, 2020

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
You can’t perform that action at this time.