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

Hosting Config: Describe premium features in the upsell nudge #71750

Merged
merged 10 commits into from
Jan 11, 2023

Conversation

p-jackson
Copy link
Member

@p-jackson p-jackson commented Jan 6, 2023

Proposed Changes

Users in the treatment cohort of the calypso_hosting_configuration_upsell_list_features experiment see an updated upsell nudge on the /hosting-config page.

CleanShot 2023-01-09 at 18 47 15@2x

  • Uses <Experiment> component to switch between the two banner variations (read more pbxNRc-2f8-p2)
  • Displays spinner if experiment cohort is still being loaded/assigned
  • Custom icon for each feature we're listing: pdKhl6-1th-p2#comment-1839
  • Columns resize and wrap as the screen width changes
  • CTA links to the checkout, just like the previous nudge
  • Banner uses the same tracks events so that the experiment tools can make the comparison

Implementation Discussion

The <UpsellBanner> and <Banner> components feel like god-classes. They have a lot of properties to toggle between all their different modes. Ideally these components would be more composable rather than have lots of modes e.g rather than exposing a primaryButton prop it would allow users to provide their own button.

Rather than adding yet more flags to the shared components I've been able to achieve most of the re-styling in CSS. However the CSS selectors need to be very specific (especially overloading specific media queries) which is not ideal. I suppose it's arguable which is better for long-term maintainability: god-components vs. fragile CSS overrides. I'd be interested in your thoughts.

Out of scope for this PR

This PR doesn't:

  • represent the final copy. We'll have time to adjust that.
  • include the price as scene in the figma design. I'll do that in a follow up PR.

Testing Instructions

  • Go to experiment page 20995-explat-experiment
  • Add the treatment bookmarklet to your bookmark bar
  • Click bookmarklet and add your user to the treatment cohort (tutorial video p1673249013170409/1673241333.083479-slack-C04H4NY6STW)
  • calypso.localhost:3000/hosting-config in a site with no business plan
  • You should see the new nudge
  • Test being in the other cohort too to confirm nothing has changed.

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • Have you written new tests for your changes?
  • Have you tested the feature in Simple (P9HQHe-k8-p2), Atomic (P9HQHe-jW-p2), and self-hosted Jetpack sites (PCYsg-g6b-p2)?
  • Have you checked for TypeScript, React or other console errors?
  • Have you used memoizing on expensive computations? More info in Memoizing with create-selector and Using memoizing selectors and Our Approach to Data
  • Have we added the "[Status] String Freeze" label as soon as any new strings were ready for translation (p4TIVU-5Jq-p2)?
  • For changes affecting Jetpack: Have we added the "[Status] Needs Privacy Updates" label if this pull request changes what data or activity we track or use (p4TIVU-ajp-p2)?

Related to #71598

@p-jackson p-jackson self-assigned this Jan 6, 2023
@github-actions
Copy link

github-actions bot commented Jan 6, 2023

@matticbot
Copy link
Contributor

matticbot commented Jan 6, 2023

Here is how your PR affects size of JS and CSS bundles shipped to the user's browser:

App Entrypoints (~27 bytes added 📈 [gzipped])

name           parsed_size           gzip_size
entry-stepper       +114 B  (+0.0%)      +27 B  (+0.0%)

Common code that is always downloaded and parsed every time the app is loaded, no matter which route is used.

Sections (~3368 bytes added 📈 [gzipped])

name                            parsed_size           gzip_size
hosting                            +10513 B  (+2.0%)    +3209 B  (+2.0%)
themes                               +114 B  (+0.0%)      +29 B  (+0.0%)
theme                                +114 B  (+0.0%)      +23 B  (+0.0%)
stats                                +114 B  (+0.0%)      +23 B  (+0.0%)
settings-writing                     +114 B  (+0.0%)      +23 B  (+0.0%)
settings-security                    +114 B  (+0.0%)      +23 B  (+0.0%)
settings-performance                 +114 B  (+0.0%)      +23 B  (+0.0%)
settings                             +114 B  (+0.0%)      +23 B  (+0.0%)
posts-custom                         +114 B  (+0.0%)      +23 B  (+0.0%)
posts                                +114 B  (+0.0%)      +23 B  (+0.0%)
plugins                              +114 B  (+0.0%)      +23 B  (+0.0%)
media                                +114 B  (+0.0%)      +23 B  (+0.0%)
marketing                            +114 B  (+0.0%)      +23 B  (+0.0%)
earn                                 +114 B  (+0.0%)      +23 B  (+0.0%)
domains                              +114 B  (+0.0%)      +32 B  (+0.0%)
activity                             +114 B  (+0.0%)      +23 B  (+0.0%)
site-purchases                        +31 B  (+0.0%)       +9 B  (+0.0%)
purchases                             +31 B  (+0.0%)       +9 B  (+0.0%)
plans                                 +31 B  (+0.0%)      +11 B  (+0.0%)
people                                +31 B  (+0.0%)      +12 B  (+0.0%)
jetpack-cloud-partner-portal          +31 B  (+0.0%)       +2 B  (+0.0%)
jetpack-cloud-agency-dashboard        +31 B  (+0.0%)       +8 B  (+0.0%)
email                                 +31 B  (+0.0%)       +9 B  (+0.0%)
backup                                +31 B  (+0.0%)      +10 B  (+0.0%)

Sections contain code specific for a given set of routes. Is downloaded and parsed only when a particular route is navigated to.

Async-loaded Components (~60 bytes added 📈 [gzipped])

name                                                     parsed_size           gzip_size
async-load-design-blocks                                      +114 B  (+0.0%)      +27 B  (+0.0%)
async-load-calypso-reader-sidebar                             +114 B  (+0.1%)      +23 B  (+0.1%)
async-load-calypso-post-editor-editor-media-modal             +114 B  (+0.0%)      +23 B  (+0.0%)
async-load-calypso-my-sites-current-site-notice               +114 B  (+0.3%)      +23 B  (+0.2%)
async-load-calypso-components-web-preview-component           +114 B  (+0.0%)      +23 B  (+0.0%)
async-load-calypso-blocks-jitm-templates-sidebar-banner       +114 B  (+0.4%)      +23 B  (+0.3%)
async-load-calypso-blocks-jitm-templates-notice               +114 B  (+0.4%)      +23 B  (+0.3%)
async-load-calypso-blocks-jitm-templates-default              +114 B  (+0.4%)      +23 B  (+0.3%)
async-load-signup-steps-domains                                +31 B  (+0.0%)       +4 B  (+0.0%)
async-load-design-playground                                   +31 B  (+0.0%)       +6 B  (+0.0%)
async-load-design                                              +31 B  (+0.0%)       +6 B  (+0.0%)

React 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.
Gzip Size: Compressed size of the JS and CSS files. This much data needs to be downloaded over network.

Generated by performance advisor bot at iscalypsofastyet.com.

@matticbot
Copy link
Contributor

This PR modifies the release build for odyssey-stats

To test your changes on WordPress.com, run install-plugin.sh odyssey-stats test/hosting-upsell-revamp on your sandbox.

To deploy your changes after merging, see the documentation: PejTkB-3N-p2

@p-jackson p-jackson changed the title WIP: Describe premium features in the upsell nudge Hosting Config: Describe premium features in the upsell nudge Jan 9, 2023
@p-jackson p-jackson requested a review from a team January 9, 2023 07:19
@matticbot matticbot added the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Jan 9, 2023
@p-jackson p-jackson marked this pull request as ready for review January 9, 2023 07:24
@mpkelly
Copy link
Contributor

mpkelly commented Jan 9, 2023

The code is nice and clean, as is the UI! I couldn't test it, though (I sent a message on Slack). My only comment is about the icons - ideally, we'd have one of each, but some of the icons used on the banner are slightly different to those used on the hosting features.

Regarding CSS specificity: very specific CSS is a good thing in this code base IMO. 😄

A nice start to 2023, @p-jackson!

@p-jackson
Copy link
Member Author

My only comment is about the icons - ideally, we'd have one of each, but some of the icons used on the banner are slightly different to those used on the hosting features.

Yeah good point I hadn't noticed that. The problem is that the cards don't line up 1-to-1 with features. The credentials card at the top is needed to use SFTP, SSH or CLI; so which icon should it match with?

CleanShot 2023-01-10 at 12 56 13@2x

And sometimes the card refers to SSH and sometimes it doesn't.

CleanShot 2023-01-10 at 12 57 09@2x

So it's not just a matter of lining them up.

Since the first card is the only situation when this clash of icons is apparent (since the overlay fades out the rest of the cards) I think I can just come up with a fix for this one. Since it's the credentials card I'll try using a key icon or something.

@p-jackson
Copy link
Member Author

This PR changes the icon to a key #71828

@mpkelly
Copy link
Contributor

mpkelly commented Jan 11, 2023

Looks good to me and can be merged. If I were being ultra picky I would say some icons could be flipped in RTL mode:

image

Using transform: scale(-1, 1);

image

(I am curious to know how the PHP would even look to a person that reads RTL).

I tested with Firefox and Chrome on mobile, tablet and desktop.

You should consider updating the Calypso examples to include a banner in this style. It was updated in #71597 but only to show simple list items. I am a big fan of rich content like this and think we should promote it.

@p-jackson
Copy link
Member Author

Thanks for testing RTL!
English words and letters don't get mirror flipped when written in Arabic, so I don't think it makes sense to flip that icon (we're moving to a Database icon anyway). The CLI icon is interesting though! I'm googling-image-searching for what localised terminals look like.

@p-jackson p-jackson merged commit fe44e45 into trunk Jan 11, 2023
@p-jackson p-jackson deleted the test/hosting-upsell-revamp branch January 11, 2023 22:25
@github-actions github-actions bot removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Jan 11, 2023
@p-jackson
Copy link
Member Author

I was able to see what the standard terminal application looks like in RTL

CleanShot 2023-01-12 at 11 30 36@2x

The prompt still renders LTR, so I don't think the icon needs to change.

@a8ci18n
Copy link

a8ci18n commented Jan 12, 2023

This Pull Request is now available for translation here: https://translate.wordpress.com/deliverables/7727672

Thank you @p-jackson for including a screenshot in the description! This is really helpful for our translators.

@a8ci18n
Copy link

a8ci18n commented Jan 20, 2023

Translation for this Pull Request has now been finished.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants