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: add Regions/Cities tab #97948

Merged
merged 1 commit into from
Jan 6, 2025
Merged

Stats: add Regions/Cities tab #97948

merged 1 commit into from
Jan 6, 2025

Conversation

myhro
Copy link
Contributor

@myhro myhro commented Jan 4, 2025

Related to Automattic/jetpack-roadmap#2093.

Proposed Changes

Why are these changes being made?

  • (p1HpG7-rpL-p2)

Testing Instructions

  • Go to the Calypso Live preview environment.
  • Access the Stats page of a website that has meaningful data, like /stats/day/jetpack.com?flags=stats/locations
    • It's important to keep the feature flag to enable the visualization.
  • Scroll down to the map and click on the Regions and Cities tabs below it.

Regions

Before After
image image

Cities

Before After
image 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)?

@matticbot
Copy link
Contributor

matticbot commented Jan 4, 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-regions-tab on your sandbox.

@matticbot
Copy link
Contributor

matticbot commented Jan 4, 2025

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

Sections (~121 bytes added 📈 [gzipped])

name                               parsed_size           gzip_size
stats                                    +78 B  (+0.0%)      +34 B  (+0.0%)
woocommerce-installation                 +12 B  (+0.0%)       +5 B  (+0.0%)
woocommerce                              +12 B  (+0.0%)       +5 B  (+0.0%)
themes                                   +12 B  (+0.0%)       +3 B  (+0.0%)
theme                                    +12 B  (+0.0%)       +3 B  (+0.0%)
subscribers                              +12 B  (+0.0%)       +4 B  (+0.0%)
staging-site                             +12 B  (+0.0%)       +4 B  (+0.0%)
sites-dashboard                          +12 B  (+0.0%)       +4 B  (+0.0%)
site-tools                               +12 B  (+0.0%)       +4 B  (+0.0%)
site-settings                            +12 B  (+0.0%)       +4 B  (+0.0%)
site-purchases                           +12 B  (+0.0%)       +6 B  (+0.0%)
site-performance                         +12 B  (+0.0%)       +4 B  (+0.0%)
site-overview                            +12 B  (+0.0%)       +4 B  (+0.0%)
site-monitoring                          +12 B  (+0.0%)       +4 B  (+0.0%)
site-marketing                           +12 B  (+0.0%)       +4 B  (+0.0%)
site-logs                                +12 B  (+0.0%)       +4 B  (+0.0%)
settings-writing                         +12 B  (+0.0%)       +5 B  (+0.0%)
settings-security                        +12 B  (+0.0%)       +5 B  (+0.0%)
settings-reading                         +12 B  (+0.0%)       +5 B  (+0.0%)
settings-podcast                         +12 B  (+0.0%)       +5 B  (+0.0%)
settings-performance                     +12 B  (+0.0%)       +5 B  (+0.0%)
settings-newsletter                      +12 B  (+0.0%)       +5 B  (+0.0%)
settings-jetpack                         +12 B  (+0.0%)       +5 B  (+0.0%)
settings-discussion                      +12 B  (+0.0%)       +5 B  (+0.0%)
settings                                 +12 B  (+0.0%)       +6 B  (+0.0%)
scan                                     +12 B  (+0.0%)       +5 B  (+0.0%)
purchases                                +12 B  (+0.0%)       +6 B  (+0.0%)
promote-post-i2                          +12 B  (+0.0%)       +5 B  (+0.0%)
preview                                  +12 B  (+0.0%)       +5 B  (+0.0%)
posts-custom                             +12 B  (+0.0%)      +10 B  (+0.0%)
posts                                    +12 B  (+0.0%)      +10 B  (+0.0%)
plugins                                  +12 B  (+0.0%)       +4 B  (+0.0%)
plans                                    +12 B  (+0.0%)       +6 B  (+0.0%)
people                                   +12 B  (+0.0%)       +4 B  (+0.0%)
pages                                    +12 B  (+0.0%)       +5 B  (+0.0%)
migrate                                  +12 B  (+0.0%)       +5 B  (+0.0%)
media                                    +12 B  (+0.0%)       +9 B  (+0.0%)
marketplace                              +12 B  (+0.0%)       +3 B  (+0.0%)
marketing                                +12 B  (+0.0%)       +5 B  (+0.0%)
jetpack-social                           +12 B  (+0.0%)       +5 B  (+0.0%)
jetpack-search                           +12 B  (+0.0%)       +5 B  (+0.0%)
jetpack-connect                          +12 B  (+0.0%)       +4 B  (+0.0%)
jetpack-cloud-settings                   +12 B  (+0.0%)       +6 B  (+0.0%)
jetpack-cloud-pricing                    +12 B  (+0.0%)       +5 B  (+0.0%)
jetpack-cloud-plugin-management          +12 B  (+0.0%)       +4 B  (+0.0%)
jetpack-cloud-overview                   +12 B  (+0.0%)       +5 B  (+0.0%)
jetpack-cloud-features-comparison        +12 B  (+0.0%)       +5 B  (+0.0%)
jetpack-cloud                            +12 B  (+0.0%)       +5 B  (+0.0%)
import                                   +12 B  (+0.0%)       +4 B  (+0.0%)
hosting-features                         +12 B  (+0.0%)       +4 B  (+0.0%)
hosting                                  +12 B  (+0.0%)       +4 B  (+0.0%)
home                                     +12 B  (+0.0%)       +5 B  (+0.0%)
gutenberg-editor                         +12 B  (+0.0%)       +5 B  (+0.0%)
google-my-business                       +12 B  (+0.0%)       +5 B  (+0.0%)
github-deployments                       +12 B  (+0.0%)       +4 B  (+0.0%)
export                                   +12 B  (+0.0%)       +5 B  (+0.0%)
email                                    +12 B  (+0.0%)       +4 B  (+0.0%)
earn                                     +12 B  (+0.0%)       +6 B  (+0.0%)
domains                                  +12 B  (+0.0%)       +4 B  (+0.0%)
customize                                +12 B  (+0.0%)       +5 B  (+0.0%)
concierge                                +12 B  (+0.0%)       +5 B  (+0.0%)
comments                                 +12 B  (+0.0%)       +5 B  (+0.0%)
checkout                                 +12 B  (+0.0%)       +4 B  (+0.0%)
backup                                   +12 B  (+0.0%)       +5 B  (+0.0%)
add-ons                                  +12 B  (+0.0%)       +5 B  (+0.0%)
activity                                 +12 B  (+0.0%)       +5 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.

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.

@myhro myhro force-pushed the add/stats-regions-tab branch from 95d7a17 to 72417e7 Compare January 6, 2025 15:56
@myhro myhro changed the title [WIP] Stats: add 'Regions' tab Stats: add Regions/Cities tab Jan 6, 2025
@@ -437,7 +437,7 @@ export const normalizers = {

// ’ in country names causes google's geo viz to break
return {
label: country.country_full.replace( /’/, "'" ),
label: viewData.location || country.country_full.replace( /’/, "'" ),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The required change was so small that I didn't make a statsCountryViews equivalent, like statsLocationViews, for now. Maybe this will be required when plotting the regions/cities in the geochart map, but let's do it when/if required.

@myhro myhro marked this pull request as ready for review January 6, 2025 16:22
@myhro myhro requested review from Initsogar and a team January 6, 2025 16:23
@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 6, 2025
Copy link
Contributor

@Initsogar Initsogar 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! Tested and works as expected :)

@myhro myhro merged commit 7eaeaae into trunk Jan 6, 2025
15 of 16 checks passed
@myhro myhro deleted the add/stats-regions-tab branch January 6, 2025 17:38
@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 6, 2025
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.

3 participants