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
Premium Patterns: add pink dot #47896
Conversation
This PR does not affect the size of JS and CSS bundles shipped to the user's browser. Generated by performance advisor bot at iscalypsofastyet.com. |
Caution: This PR affects files in the Editing Toolkit Plugin on WordPress.com D53559-code has been created so you can easily test it on your sandbox. See this FieldGuide page about developing the Editing Toolkit Plugin for more info: PCYsg-ly5-p2 |
Thanks for creating the new PR and updating to the pink dot @deBhal! It's looking good on my test site: From re-reading the update on pbAok1-1D1-p2#comment-3410 it sounds like the popover has been de-scoped at this stage, so I think we can remove that, too (though I was happy with the work we did to make it possible!) |
PatternPopover removed in: 45a1672 |
apps/editing-toolkit/editing-toolkit-plugin/block-patterns/class-block-patterns-from-api.php
Outdated
Show resolved
Hide resolved
apps/editing-toolkit/editing-toolkit-plugin/full-site-editing-plugin.php
Outdated
Show resolved
Hide resolved
if ( $this->can_register_pattern( $pattern ) ) { | ||
$is_premium = in_array( 'premium_block_pattern', array_keys( $pattern['tags'] ), true ); |
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.
Once D53825-code lands, we'll just need to update this line to check for $pattern['pattern_meta']['is_premium']
.
@deBhal it's probably worth giving this one a rebase against |
144ab02
to
2769e9f
Compare
I can't comment on the It's working well ❤️ |
Is this still being fired now that we have the in-editor upgrade button? I can't find it in my network requests anymore. Maybe we'll need to update the openCheckout event? If we have the A/B test running is this still important. I see how it will be still useful to know which block has prompted the user to upgrade. What do you think @razvanpapadopol ? (cc'ing you because you featured in the annotations :) ) |
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 tested this according to the instructions, and then again in conjunction with D53680-code
I don't have any specific comments in relation to the code, but functionality-wise, it looks great to me
Thanks for testing @ramonjd! I'll merge this in shortly, and I thought we could look at improvements to which events we fire in follow ups. |
Yes, this is still fired and it has a
No, we're not using
As mentioned above, we know already on which block the upgrade button was pressed. However, the volume is still quite low to get any conclusions. |
This PR drops the premium popover from #47351, copied into this new PR in case we want it again later.
Changes proposed in this Pull Request
This PR is a temporary method to modify premium patterns in the inserter until changes come through in Gutenberg to facilitate this sort of thing, and we should replace this with those mechanisms as soon as they are available.
In the meantime, we:
__experimentalBlockPatterns
in the block editor settings, to swap out thetitle
value for a React element to add in a Premium badgeAdd hover behaviour to show more information about a premium pattern when the user mouses over the pattern previewUpdate: the PatternPopover has been de-scoped.Target Design:
WIP screenshots
Showing the pink dot on a test pattern:
Todos (carried over from #47351)
isPremium
value when registering patterns so that we only render the badge when we expect to.isPremium
value when a pattern has thepremium
tag.Try expanding the pattern title container to include the whole pattern and then add hover state to display a tooltip with more information about the premium pattern.(de-scoped)Hook up the(de-scoped)pattern.description
value to the PatternPopover, this will require setting it from the API response in https://github.com/automattic/wp-calypso/blob/63d7b360972c3c483b6a259c5d482250982ab8ab/apps/editing-toolkit/editing-toolkit-plugin/block-patterns/class-block-patterns-from-api.php#L96 (currently we're using the title as the description, too)Make sure the popover works correctly on mobile(de-scoped)is_premium
within thepattern_meta
key of the response from the ptk/patterns endpoint (patterm_meta
key added in D53825-code)Add A/B test flag(replaced with a filter, and the A/B test is handled separately — D53680-code)Add an e2e or lint test that (somehow!) tests for the existence of the(more context p4TIVU-9xW-p2#comment-10763) (being worked on separately in Add __experimentalBlockPatterns tests #48032 / Update experimental features tests #48164)__experimentalBlockPatterns
key ofgetSettings()
and document instructions of what to do if it fails (e.g. ping Ganon)Testing instructions
0-sandbox.php
file add the following to get your sandboxed test site to request patterns from a test source site. A good one to use is andysfakeblockpatternsourcesite (there's a premium pattern under the Premium category) followed by the domain, but any valid source site with patterns tagged withis_premium
in Pattern Meta will do:Also, you will need to switch on the feature in your sandbox with:
andysfakeblockpatternsourcesite
source site, you should see a premium pattern under thePremium
category.is_premium
under the Audio category, however due to caching it will likely take a while for this to show up on a test site.__experimentalBlockPatterns
in the way that we have look safe enough for the purposes of our experiment? Is there any noticeable slow down to opening the pattern inserter?Fixes #47225