-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Tenor integration #13949
Tenor integration #13949
Conversation
Add Tenor feature flag
Split unit tests into smaller ones
Tenor API credentials support
Implement Tenor client api
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good to me, just a few comments there and then the functional issues I mentioned before.
I've also seen the Couldn't decode API response from Tenor
error logged out a few times while testing this, but I'm not sure why yet.
return origin.eventForMediaType(mediaType) | ||
} | ||
|
||
// Old tracking events via WPShared | ||
// Ref: https://iosp2.wordpress.com/2020/03/16/adding-tracks-forget-wordpress-shared/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably shouldn't include a p2 reference here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two more of these below too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done thanks @frosty
func eventForMediaType(_ mediaType: MediaType) -> WPAnalyticsStat? { | ||
// All new media tracking events will be added into WPAnalyticsEvent | ||
// Ref: https://iosp2.wordpress.com/2020/03/16/adding-tracks-forget-wordpress-shared/ | ||
func eventForMediaType(_ mediaType: MediaType) -> WPAnalyticsEvent? { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not entirely sure why these definitions need to be split out from the existing definitions below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @frosty because the old tracking method uses WPAnalyticsStat
from WPShared
pod while the new method uses a new enum WPAnalyticsEvent
@@ -159,4 +186,5 @@ enum MediaSource { | |||
case camera | |||
case giphy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note for a future PR: we should remove all the existing Giphy references
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is already a task for this #13803 ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks!
@@ -64,6 +76,10 @@ final class AztecMediaPickingCoordinator { | |||
giphy.presentPicker(origin: origin, blog: blog) | |||
} | |||
|
|||
private func showTenor(origin: UIViewController, blog: Blog) { | |||
tenor.presentPicker(origin: origin, blog: blog) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The media library and Gutenberg both create a new Tenor picker each time one needs to be presented. Should we do the same here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume it should be a YES answer. I believe the Gutenberg editor is the future of editor (69% uses have used it) so o I will make a change for this to make it consistent to Aztec/Media.
static func configureAsIntro(_ viewController: NoResultsViewController) { | ||
viewController.configure(title: .tenorPlaceholderTitle, | ||
image: Constants.imageName, | ||
subtitleImage: "tenor-attribution") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could probably go in the Constants enum too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Thanks @frosty
} | ||
|
||
func numberOfAssets(of mediaType: WPMediaType, completionHandler: WPMediaCountBlock? = nil) -> Int { | ||
return 10 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we know why this is set to 10?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The TenorMediaGroup
is created just to make the TenorDataSource
conformed to the WPMediaCollectionDataSource
protocol. Since we haven't supported media groups (e.g group by categories) in all media sources (StockPhotos, Giphy, Tenor). So 10 or any doesn't matter. StockPhotos uses 10, Giphy uses 10, Tenor (is a Giphy clone), has 10 too. :d
@frosty thanks for the review. I will try to address your comments as much as I can. Some of them were not entirely belong to the Tenor Picker itself, it's part of the app's existing and (inconsistent) behaviour so they should be tracked separately ;-) |
To support animating GIF, the implementation of Tenor Picker injected an Overlay view for |
Improvements for Tenor picker to address comments in #13949
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think let's get this merged, but keep it feature flagged and ensure we have any remaining items captured in the master issue (I just added all of my issues there).
Thanks @frosty ! |
Ref #13803
This PR is to merge the Tenor feature branch into
develop
. It encompasses @ngoctr 's PRs for the tasks marked as complete on #13803 .Accessing the
Free GIF Library
from any of the following paths presents the same Tenor picker, and should all look/behave the same:To test:
Media Library:
+
on the nav bar.Free GIF Library
is an option. Select it.Block Editor:
Free GIF Library
is an option. Select it.NOTE: there is a known issue where Previewing a post before media finishes uploading breaks the media. This applies to any media type, in both editors.
Classic Editor:
Free GIF Library
is an option. Select it.PR submission checklist:
RELEASE-NOTES.txt
if necessary.