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

Site Profiler: Add a blur effect for locked metrics #90703

Merged
merged 2 commits into from
May 16, 2024

Conversation

WBerredo
Copy link
Contributor

@WBerredo WBerredo commented May 14, 2024

Fixes https://github.com/Automattic/dotcom-forge/issues/6676

Proposed Changes

Add a blurry effect for locked metrics. The icon will also change to a locker.

CleanShot 2024-05-14 at 13 34 11@2x

Why are these changes being made?

The list of metrics should show blurred items when on teaser mode.

Testing Instructions

  • Go to /site-profiler/:url. Ex: /site-profiler/example.com
  • Scroll down and check if the metrics of the Health Scores section is blurred as the image above.

Pre-merge Checklist

  • Has the general commit checklist been followed? (PCYsg-hS-p2)
  • https://wpcalypso.wordpress.com/devdocs/docs/testing/index.md 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 14, 2024

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

Sections (~414 bytes added 📈 [gzipped])

name           parsed_size           gzip_size
site-profiler      +1083 B  (+1.1%)     +414 B  (+1.5%)

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.

const InsightHeader = styled.div`
font-family: 'SF Pro Text';
font-size: 16px;
filter: ${ ( props: InsightHeaderProps ) => ( props.locked ? 'blur(2px)' : 'none' ) };
Copy link
Contributor

@gavande1 gavande1 May 15, 2024

Choose a reason for hiding this comment

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

Using the blur filter works as expected. However, I could easily see the hidden text by toggling one CSS rule. Is there any better way to achieve similar results? Do we want to obfuscate the details in any way?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My idea here is really to use text that doesn't mean much to be blurred (as the sentences I added in useLockedInsights).

This should also help us to not need to retrieve any information at this step, which will not be available yet.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think if we want to obfuscate the text we could generate a temp image from the backend with the blurred text.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But at this point, we don't have the data, the blurred text is to be shown during teaser stage.

Base automatically changed from add/metrics-insight-list to trunk May 15, 2024 15:57
Copy link
Contributor

@JulianBustamante JulianBustamante left a comment

Choose a reason for hiding this comment

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

LGTM!

@WBerredo WBerredo merged commit 1362a02 into trunk May 16, 2024
11 checks passed
@WBerredo WBerredo deleted the add/metrics-list-blur branch May 16, 2024 16:28
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.

4 participants