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

Post settings: Featured Image preview is too small #33838

Closed
wants to merge 1 commit into from
Closed

Post settings: Featured Image preview is too small #33838

wants to merge 1 commit into from

Conversation

gavande1
Copy link

@gavande1 gavande1 commented Aug 3, 2021

Description

By default, the featured image preview uses the post-thumbnail version of an image. In Gutenberg, the featured image component first tries to use that value and otherwise uses the fallback value of the thumbnail. This PR aims to use the full version image instead of using the thumbnail version of the featured post image as a fallback.

Fixes: #33837

How has this been tested?

  1. On the dev site create a new post
  2. Open the settings sidebar (by clicking the cog icon in the top right of the editor)
  3. Select the "Post" tab and scroll to the "Featured Image" section
  4. Add a Featured Image and see if the featured image covers the available area.

Screenshots

Before / After

Types of changes

Enhancement

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • I've tested my changes with keyboard and screen readers.
  • 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 (please manually search all *.native.js files for terms that need renaming or removal).
@github-actions
Copy link

github-actions bot commented Aug 3, 2021

👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @gavande1! In case you missed it, we'd love to have you join us in our Slack community, where we hold regularly weekly meetings open to anyone to coordinate with each other.

If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information.

@github-actions github-actions bot added the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label Aug 3, 2021
@cpapazoglou
Copy link
Contributor

@ntsekouras, can you advise us whether this change seems good? In my POV, post-thumbnail is set by themes to better reflect the quality and the aspect-ratio of the featured image. If post-thumbnail doesn't exist, it doesn't make sense falling back to thumbnail since this is not what users will get in the frontend, quality & aspect-ratio wise. full is our best bet I think.

@ntsekouras
Copy link
Contributor

ntsekouras commented Aug 3, 2021

Thanks for your contribution @gavande1 and for the ping @cpapazoglou ! IMO featured image preview shouldn't create any expectations to a user, as the final display(front-end) is handled by the theme and could be of any size/aspect-ratio etc... For example we could apply a change to show full image, but the theme displays only thumbnails 😄 .

By seeing the current code in trunk, this feels okay to me, but would like another opinion from @mcsf or @gziolo maybe 😄 ?

@Mamaduka
Copy link
Member

Mamaduka commented Aug 3, 2021

Maybe we should use large instead of the full as a fallback image size value? It is also the current default image size for the editor.

Featured Image will use the full-size image if the first two options aren't available.

} else {
// use full image size when mediaFallbackSize and mediaSize are not available
mediaWidth = media.media_details.width;
mediaHeight = media.media_details.height;
mediaSourceUrl = media.source_url;
}

@gavande1
Copy link
Author

gavande1 commented Aug 3, 2021

We could use the large or medium but they can be configured by the user within media options. So if the user changes the size of large to 150 then we're back to square one. That's why the size full is proposed which is not configurable by the user.

@ntsekouras
Copy link
Contributor

By seeing the current code in trunk, this feels okay to me,

I wanted to clarify that with the above I meant that I think the code in trunk is good as is and we don't need to change it - I read it and felt a bit confusing to me, thus the explaining here 😄

We could use the large or medium but they can be configured by the user within media options. So if the user changes the size of large to 150 then we're back to square one. That's why the size full is proposed which is not configurable by the user.

Letting users have control in these sizes is the purpose of the existence and appliance of these filters, no? Why override them with something opinionated? As I said the preview is not representative to the end result, the theme is and the way I see it is better to load a smaller image, which is just a preview of the image to help a user recognize what image they have set.

@skorasaurus skorasaurus added the [Feature] Media Anything that impacts the experience of managing media label May 5, 2022
@gavande1 gavande1 closed this Oct 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Media Anything that impacts the experience of managing media First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository
5 participants