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

Stats: adds replacement subscribers chart #99332

Merged
merged 3 commits into from
Feb 11, 2025

Conversation

annacmc
Copy link
Contributor

@annacmc annacmc commented Feb 5, 2025

Related to #

Proposed Changes

  • This PR replaces the subscribers page line chart with the new chart library line chart
  • It is only visible behind the feature flag
  • It is not currently wired up for correct data, it's just dummy data
  • This is a followon PR from Stats: adds chart library feature flag #99316

Testing Instructions

  • Open Calypso live branch
  • Navigate to /stats/subscribers/{URL}i?flags=stats/chart-library
  • Check everything appears as normal
  • Append feature flag flags=stats/chart-library
  • Check you can now see the new chart as pictured below

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

@annacmc annacmc changed the base branch from trunk to add/stats-chart-library-feature-flag February 5, 2025 08:18
@annacmc annacmc requested review from kangzj and a team February 5, 2025 08:18
@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 Feb 5, 2025
@annacmc annacmc self-assigned this Feb 5, 2025
@annacmc annacmc added the [Stats] Subscribers Subscribers Stats related label Feb 5, 2025
@matticbot
Copy link
Contributor

matticbot commented Feb 5, 2025

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 add/stats-subscribers-chart-add-new-library on your sandbox.

@matticbot
Copy link
Contributor

matticbot commented Feb 5, 2025

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

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

name                                                 parsed_size           gzip_size
async-load-calypso-my-sites-stats-pages-subscribers       +683 B  (+0.5%)     +192 B  (+0.4%)

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.

Base automatically changed from add/stats-chart-library-feature-flag to trunk February 5, 2025 08:22
@annacmc annacmc force-pushed the add/stats-subscribers-chart-add-new-library branch from 85051a1 to 10a731c Compare February 6, 2025 23:02
@kangzj kangzj added the [Feature] Stats Everything related to our analytics product at /stats/ label Feb 7, 2025
{
label: 'Subscribers',
options: {
stroke: '#069e08',
Copy link
Contributor

Choose a reason for hiding this comment

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

We should have use different color for Calypso

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup absolutely. On my current PR list to add a Calypso color theme to the chart library, which we can use webpack in Odyssey to replace it with the Jetpack theme.

data: data?.data?.map( ( point ) => ( {
date: new Date( point.period ),
value: point.subscribers || 0,
} ) ) || [
Copy link
Contributor

Choose a reason for hiding this comment

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

Happy to keep the dummy data for now, but let's remove it before going live

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep totally 👍 This is just a small chunk of a PR to put the chart component in. Will definitely replace the dummy data in one of my followup PRs. Just making an adjustment to the component structure to handle both realtime (as currently) data and static/periodic data.

Copy link
Contributor

@kangzj kangzj left a comment

Choose a reason for hiding this comment

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

Nice work! Let's ship and iterate after addressing lazy loading!

I also noticed the numbers are cut off for Y axis:

Screenshot 2025-02-07 at 2 02 53 PM

@annacmc annacmc force-pushed the add/stats-subscribers-chart-add-new-library branch from 10a731c to 03f9001 Compare February 11, 2025 07:42
@annacmc annacmc merged commit 5e05e03 into trunk Feb 11, 2025
13 checks passed
@annacmc annacmc deleted the add/stats-subscribers-chart-add-new-library branch February 11, 2025 10:20
@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 Feb 11, 2025
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.

3 participants