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

Add info popover for tier dropdown #90600

Merged
merged 3 commits into from May 15, 2024

Conversation

CodeyGuyDylan
Copy link
Contributor

Proposed Changes

  • Add info popover for tier dropdown in lightbox

Testing Instructions

  1. Using the Claypso Green go to the /pricing page
  2. Open up the AI lightbox (this will work with stats too once this PR is merged and this is rebased)
  3. Make sure the info popover is there and that it opens and the content makes sense
    image

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-aUh-p2)?

@matticbot
Copy link
Contributor

matticbot commented May 10, 2024

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

Sections (~517 bytes added 📈 [gzipped])

name                               parsed_size           gzip_size
plans                                  +1168 B  (+0.1%)     +251 B  (+0.1%)
jetpack-connect                        +1168 B  (+0.1%)     +251 B  (+0.1%)
jetpack-cloud-pricing                  +1168 B  (+0.1%)     +251 B  (+0.1%)
jetpack-cloud-features-comparison      +1168 B  (+0.2%)     +266 B  (+0.1%)

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

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.

// The lightbox z-index is 100200, consequences of updating the popover z-index
// to higher than that are unclear, so we'll manually set it to 100200 here so we
// can see the popover in the lightbox.
.popover {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be more specific (with a class name added to the popover) to prevent styles seeping elsewhere after this stylesheet is loaded? Perhaps also included alongside the other z-index mappings: https://github.com/Automattic/wp-calypso/blob/trunk/client/assets/stylesheets/shared/functions/_z-index.scss

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree with that! Especially since <InfoPopover /> allows for adding custom modifier class names, we should leverage that - instead of providing a global change as it's not our intention.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you both on this, I went ahead and added the class that was added to the component to specify it more. I can't nest it because the popover itself is rendered outside the parent component but this should keep it specific to this popover

Copy link
Contributor

@robertsreberski robertsreberski left a comment

Choose a reason for hiding this comment

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

Besides the comments, the change tests good!

// The lightbox z-index is 100200, consequences of updating the popover z-index
// to higher than that are unclear, so we'll manually set it to 100200 here so we
// can see the popover in the lightbox.
.popover {
Copy link
Contributor

Choose a reason for hiding this comment

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

I agree with that! Especially since <InfoPopover /> allows for adding custom modifier class names, we should leverage that - instead of providing a global change as it's not our intention.

screenReaderText={ translate( 'Learn more' ) }
className="product-lightbox__variants-dropdown--popover"
>
{ PRODUCT_OPTIONS_HEADER_INFO_CONTENT[ product?.productSlug ] }
Copy link
Contributor

Choose a reason for hiding this comment

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

We might want to use preventWidows() formatting function - currently I see the widow on the screenshot attached to the PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice suggestion for improvement thank you!

Copy link
Contributor

@robertsreberski robertsreberski left a comment

Choose a reason for hiding this comment

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

Looks good!

@CodeyGuyDylan CodeyGuyDylan force-pushed the add/info-popover-for-tiers-dropdown branch from 17b72da to 79320c9 Compare May 15, 2024 15:00
@matticbot
Copy link
Contributor

matticbot commented May 15, 2024

This PR modifies the release build for the following Calypso Apps:

For info about this notification, see here: PCYsg-OT6-p2

  • odyssey-stats
  • wpcom-block-editor

To test WordPress.com changes, run install-plugin.sh $pluginSlug add/info-popover-for-tiers-dropdown on your sandbox.

@CodeyGuyDylan CodeyGuyDylan merged commit 83ccf7c into trunk May 15, 2024
11 checks passed
@CodeyGuyDylan CodeyGuyDylan deleted the add/info-popover-for-tiers-dropdown branch May 15, 2024 15:39
chad1008 pushed a commit that referenced this pull request May 21, 2024
* Add info popover for  tier dropdown

* Prevent widows and specify css class for zindex

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

Successfully merging this pull request may close these issues.

None yet

4 participants