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

Email stats: hide when post was not sent #97739

Merged
merged 1 commit into from
Dec 23, 2024
Merged

Conversation

simison
Copy link
Member

@simison simison commented Dec 23, 2024

Resolves Automattic/jetpack#40724

Depends on Automattic/jetpack#40723 merged and deployed to WP.com.

Proposed Changes

  • Hide email open/click tabs for individual post stats when post wasn't even sent as email.

This is different from Newsletters being disabled for the site entirely; I'll do a follow up PR to hide tabs in that case, too.

Alternatively we could keep showing tabs, but indicate somehow that the post wasn't sent as an email.

Post that wasn't sent as an email

Screenshot 2024-12-23 at 14 08 13

Post that was sent as an email

Screenshot 2024-12-23 at 14 08 38

Why are these changes being made?

Testing Instructions

  • Apply PR at your sandbox
  • Create a new post and set "post only" from "newsletter" sidebar (icon in the header) and another post with "email and post" option
  • Open stats individual posts view in Calypso at /stats/post/[POST ID]/[SITE ID]
  • See how tabs are hidden for "post only" version

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 UI changes, have we tested the change in various languages (for example, ES, PT, FR, or DE)? The length of text and words vary significantly between languages.
  • 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)?

@simison simison added [Feature] Stats Everything related to our analytics product at /stats/ [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. [Stats] Subscribers Subscribers Stats related labels Dec 23, 2024
@simison simison requested review from crisbusquets and a team December 23, 2024 12:10
@matticbot
Copy link
Contributor

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

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

name                                                 parsed_size           gzip_size
async-load-calypso-my-sites-stats-stats-post-detail       +263 B  (+0.8%)      +81 B  (+0.8%)

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.

@crisbusquets
Copy link
Contributor

It works for me!
But I wonder if this could be an entry point for the Newsletter feature 🤔 What do you think, @davemart-in ?

@matticbot
Copy link
Contributor

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

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

  • notifications
  • odyssey-stats
  • wpcom-block-editor

To test WordPress.com changes, run install-plugin.sh $pluginSlug update/hide-email-tab on your sandbox.

@simison
Copy link
Member Author

simison commented Dec 23, 2024

But I wonder if this could be an entry point for the Newsletter feature

This in case they're already using newsletters, but decided to publish individual post as blog post only and skip the email.

What you're referring would be scenario where we hide the tabs when the enire Subscriptions/Newsletters feature is disabled (not possible on simple sites, but on Jetpack sites). In that case I'd lean on still hiding these tabs specifically to stay a bit more logical/consistent with hiding them when post wasn't sent anyway.

Copy link
Contributor

@lezama lezama left a comment

Choose a reason for hiding this comment

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

code makes sense!

@simison
Copy link
Member Author

simison commented Dec 23, 2024

I'll merge this already; the backend change isn't deployed yet but this is backwards compatible, the tabs just stay visible:

image

@simison simison merged commit 3b7776c into trunk Dec 23, 2024
16 checks passed
@simison simison deleted the update/hide-email-tab branch December 23, 2024 13:43
@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 Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Stats Everything related to our analytics product at /stats/ [Stats] Subscribers Subscribers Stats related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stats: hide email stats when post wasn't sent as an email
4 participants