Add tier and price info to the Jetpack Search block on the plans page#40306
Add tier and price info to the Jetpack Search block on the plans page#40306
Conversation
|
Here is how your PR affects size of JS and CSS bundles shipped to the user's browser: Webpack Runtime (~64 bytes removed 📉 [gzipped]) DetailsWebpack runtime for loading modules. It is included in the HTML page as an inline script. Is downloaded and parsed every time the app is loaded. App Entrypoints (~1256 bytes added 📈 [gzipped]) DetailsCommon code that is always downloaded and parsed every time the app is loaded, no matter which route is used. Sections (~1499 bytes removed 📉 [gzipped]) DetailsSections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to. Async-loaded Components (~925 bytes added 📈 [gzipped]) DetailsReact components that are loaded lazily, when a certain part of UI is displayed for the first time. Legend What is parsed and gzip size?Parsed Size: Uncompressed size of the JS and CSS files. This much code needs to be parsed and stored in memory. Generated by performance advisor bot at iscalypsofastyet.com. |
| // This is a catch-all tier with prices increasing | ||
| // proportionally per million records, so define fake | ||
| // tiers here to show the user what they will actually | ||
| // pay and why. |
There was a problem hiding this comment.
Not entirely sure if this is how we want to display things for sites with 1,000,000+ records, but it seemed like the simplest way to do it for now.
There was a problem hiding this comment.
In general I wouldn't expose the tier numbers to end users, but instead just say what they can go up to. But that is all design and copy I think so this looks fine as is.
There was a problem hiding this comment.
Yeah, I was just copying it from the older designs -- it can definitely be changed. I guess maybe the idea was that it's useful to get the concept of different "tiers" into the text somehow, though, so the user can see how we're charging for things.
| // This is a catch-all tier with prices increasing | ||
| // proportionally per million records, so define fake | ||
| // tiers here to show the user what they will actually | ||
| // pay and why. |
There was a problem hiding this comment.
In general I wouldn't expose the tier numbers to end users, but instead just say what they can go up to. But that is all design and copy I think so this looks fine as is.
| optionsLabel: translate( 'Select a product option:' ), | ||
| optionsLabelCallback: productObject => { | ||
| return translate( | ||
| 'Your current site record size: %(numberOfRecords)s record', |
There was a problem hiding this comment.
Can the api response give us info of whether this is an estimate or not?
There was a problem hiding this comment.
Yes, if we need that information, we can add it to the API and use it here. Let's see if we need it once someone figures out what the final wording should be.
jsnmoon
left a comment
There was a problem hiding this comment.
This looks good and tests well; state handling works as expected.
Having some extra 👀 on the ProductSelector component would be nice before 🚢 -- that's the part I'm least confident about.
DavidRothstein
left a comment
There was a problem hiding this comment.
Thanks for the review!
|
Hm, it looks like #40402 (for Jetpack Scan) made a bunch of changes to how these product blocks display when there is only one radio option. This affects Jetpack Search too. So after rebasing this pull request it will no longer work well (the tier info and number of search records are no longer shown). Will need to figure out what the final design is going to look like, I guess. |
|
Actually, it's possible to work around the above problem with a pretty simple set of changes, so I'm pushing that up now just to get it working again with the latest code on the master branch. This is now back to displaying as shown in the screenshots in the PR description. |
2bc7a20 to
0f5de35
Compare
gibrown
left a comment
There was a problem hiding this comment.
Looks good and tests well. Some UX and copy stuff we need to polish but I think we should land this as is.
0f5de35 to
59a3274
Compare
Changes proposed in this Pull Request
/plans/[site]andjetpack/connect/...pages show information about the site's search tier and number of search records (and the corresponding price that the user will be charged if they go through and buy it).sites/[site]/productsendpoint on the server, so that Calypso can obtain the site-specific price and tier info for Jetpack Search. This code is based pretty heavily on the existing code in Calypso for querying thesites/[site]/plansendpoint.Testing instructions
/plansand select an already-connected Jetpack site. You should see something like this for the Jetpack Search block (the arrow shows the key part -- the info in this section should reflect your actual search usage as determined by the server):Note that the design and wording here aren't fully finalized, but I based the text in current version on some internal mockups at p6TEKc-3jA-p2.