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

Restore support for animated GIFs in Gutenberg. #14238

Merged
merged 6 commits into from
Jun 8, 2020

Conversation

SergioEstevao
Copy link
Contributor

@SergioEstevao SergioEstevao commented Jun 3, 2020

When we implemented our custom ImageLoader for RN, to support private sites, we accidentally removed support for playing animated GIFs while inside GB editor.
This PR changes the loading system of images to use the RCTAnimated class when a GIF is being downloaded.

One of the side effects of that change is that if the post featured image on the post/page is an animated GIF we show the animation.

Fixes #

To test:

  • Start the app
  • Create a new Post using GB
  • Add an image block and configure it to use an animated GIF
  • See if you can see the GIF animation on the editor
  • Publish the post
  • Go to the list of posts
  • See if the post card in the list of posts shows the animated GIF
  • Test this with WP.com sites, WP.org sites, Atomic sites, and WP.com private sites.

PR submission checklist:

  • I have considered adding unit tests where possible.
  • I have considered adding accessibility improvements for my changes.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

When we implemented our custom ImageLoader for RN, to support private
sites, we accidentally remove support for playing animated GIFs while
inside GB editor.
This PR changes the loading system of images to use the
RCTAnimated class when a GIF is being download.

One of the side effects of that change is that if now the featured
image on the post/page is an animated GIF we show the animation.
@SergioEstevao SergioEstevao added Media gif support Gutenberg Editing and display of Gutenberg blocks. labels Jun 3, 2020
@SergioEstevao SergioEstevao added this to the 15.1 milestone Jun 3, 2020
@SergioEstevao SergioEstevao requested review from maxme and etoledom June 3, 2020 13:44
@peril-wordpress-mobile
Copy link

peril-wordpress-mobile bot commented Jun 3, 2020

You can trigger an installable build for these changes by visiting CircleCI here.

@peril-wordpress-mobile
Copy link

peril-wordpress-mobile bot commented Jun 3, 2020

You can trigger optional UI/connected tests for these changes by visiting CircleCI here.

Copy link
Contributor

@maxme maxme left a comment

Choose a reason for hiding this comment

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

The tests I ran worked fine, GIFs are animated on the post list, in Gutenberg (doesn't work on Aztec, but I guess that's expected). I'd appreciate if someone else was reviewing the code ;).

@SergioEstevao SergioEstevao requested a review from ceyhun June 5, 2020 08:45
Copy link
Contributor

@etoledom etoledom left a comment

Choose a reason for hiding this comment

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

Thank you @SergioEstevao for this fix!
I was wondering from some time already what happened to the animated gifs on iOS 😬

Added a couple of comments on the code, but everything works great!

@SergioEstevao SergioEstevao changed the title Add support for animated GIFs in Gutenberg. Restore support for animated GIFs in Gutenberg. Jun 8, 2020
@SergioEstevao SergioEstevao merged commit aad66f4 into develop Jun 8, 2020
@SergioEstevao SergioEstevao deleted the gutenberg/restore_support_for_animated_gifs branch June 8, 2020 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Gutenberg Editing and display of Gutenberg blocks. Media
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants