Skip to content

Premium Analytics: rename to “Stats” and add the Jetpack logo - #51022

Merged
chihsuan merged 8 commits into
trunkfrom
echo/wooa7s-1784-stats-name
Aug 5, 2026
Merged

Premium Analytics: rename to “Stats” and add the Jetpack logo#51022
chihsuan merged 8 commits into
trunkfrom
echo/wooa7s-1784-stats-name

Conversation

@chihsuan

@chihsuan chihsuan commented Aug 4, 2026

Copy link
Copy Markdown
Member

Fixes WOOA7S-1784

Proposed changes

  • Use "Stats" for the dashboard heading and breadcrumbs. The wp-admin sidebar keeps "Stats v2": the beta runs the new dashboard alongside Jetpack Stats, so the two menu items have to stay distinguishable.
  • Add a shared StatsBreadcrumbs that supplies the root crumb for every page, links it back to the dashboard while preserving the current report window, and renders it as the dashboard's h1.
  • Add a StatsPageIcon that displays the Jetpack mark on the dashboard and every report and detail page.
  • Add the Jetpack mark to the package's existing icons package, avoiding a new dependency.
  • Reset wp-admin's list-item margin inside the breadcrumb wrapper so the title remains vertically centred beside the mark. This is a local stopgap: Breadcrumbs exposes no prop for it, so the same one-line reset is proposed upstream in fix(admin-ui): reset the wp-admin li margin that misaligns Breadcrumbs WordPress/gutenberg#81134. Once that ships, the wrapper and its stylesheet can both be deleted.

Related product discussion/links

Does this pull request change what data or activity we track or use?

No.

Testing instructions

  • Build and open the Premium Analytics dashboard: ?page=jetpack-premium-analytics-wp-admin.
  • Confirm the wp-admin sidebar item still reads Stats v2, so it stays distinct from the existing Stats menu.
  • On the dashboard, confirm the header reads Stats with the green Jetpack mark to its left. The title and mark should be vertically centred, and the page h1 should be "Stats" rather than "Analytics".
  • Open any report, such as Referrers, Locations, or Tags & categories. The trail should read Stats / , with the mark in the header. Clicking Stats should return to the dashboard and preserve the selected date range, such as ?preset=last-30-days.
  • Open a post or video detail page. Until the title resolves, only the Stats crumb should appear. Once it resolves, the title should become the h1, with no empty crumb shown in between.

The video below was recorded before the sidebar label was reverted, so it shows Stats in the sidebar; everything else in it still matches.

Screen.Recording.2026-08-04.at.3.23.22.PM.mov

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WoA dev site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin (Jetpack or WordPress.com Site Helper), and enable the echo/wooa7s-1784-stats-name branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack echo/wooa7s-1784-stats-name
bin/jetpack-downloader test jetpack-mu-wpcom-plugin echo/wooa7s-1784-stats-name

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


Follow this PR Review Process:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

If you have questions about anything, reach out in #jetpack-developers for guidance!

@chihsuan chihsuan changed the title Stats: name the dashboard consistently and mark it with the Jetpack logo Premium Analytics: name the dashboard consistently and mark it with the Jetpack logo Aug 4, 2026
@jp-launch-control

jp-launch-control Bot commented Aug 4, 2026

Copy link
Copy Markdown

Code Coverage Summary

Coverage changed in 16 files. Only the first 5 are listed here.

File Coverage Δ% Δ Uncovered
projects/packages/premium-analytics/routes/post-detail/stage.tsx 18/21 (85.71%) -0.65% 0 💚
projects/packages/premium-analytics/routes/reports/annual-insights/page.tsx 19/20 (95.00%) -0.24% 0 💚
projects/packages/premium-analytics/routes/reports/authors/page.tsx 17/19 (89.47%) -0.53% 0 💚
projects/packages/premium-analytics/routes/reports/clicks/page.tsx 21/23 (91.30%) -0.36% 0 💚
projects/packages/premium-analytics/routes/reports/comment-followers/page.tsx 15/15 (100.00%) 0.00% 0 💚

5 files are newly checked for coverage.

File Coverage
projects/packages/premium-analytics/packages/icons/src/jetpack/index.tsx 1/1 (100.00%) 💚
projects/packages/premium-analytics/packages/ui/src/stats-breadcrumbs/stats-breadcrumbs.tsx 2/2 (100.00%) 💚
projects/packages/premium-analytics/packages/ui/src/stats-page-icon/stats-page-icon.tsx 1/1 (100.00%) 💚
projects/packages/premium-analytics/packages/ui/src/stats-breadcrumbs/index.ts 0/0 (—%) 🤷

Full summary · PHP report · JS report

@chihsuan chihsuan changed the title Premium Analytics: name the dashboard consistently and mark it with the Jetpack logo Premium Analytics: rename to “Stats” and add the Jetpack logo Aug 4, 2026
@chihsuan
chihsuan force-pushed the echo/wooa7s-1784-stats-name branch from 7ba286b to 1307b83 Compare August 4, 2026 07:30
@chihsuan
chihsuan marked this pull request as ready for review August 4, 2026 07:32
@chihsuan
chihsuan requested review from a team as code owners August 4, 2026 07:32
@chihsuan chihsuan added [Status] Needs Review This PR is ready for review. and removed [Status] In Progress labels Aug 4, 2026
// A closure, not a string: we run on plugins_loaded, too early to translate.
// The package calls this back on admin_menu.
'menu_title' => fn () => __( 'Stats v2', 'jetpack-mu-wpcom' ),
'menu_title' => fn () => __( 'Stats', 'jetpack-mu-wpcom' ),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We probably don't want to change this?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Right — the plan for the interview beta is to keep both menu items so testers can switch between the old and new dashboards, so the sidebar has to stay Stats v2. Reverted, and with it the whole jetpack-mu-wpcom change is out of the PR. Only the page header and breadcrumbs read Stats now.

// esc_html() as a broken label instead of falling back here.
self::$resolved_menu_title = is_string( $title ) && '' !== $title
? $title
: __( 'Stats v2', 'jetpack-premium-analytics-pkg' );

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Or this?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Same here — back to Stats v2. Between this and the mu-wpcom revert the PHP diff is now empty, so the PR is frontend only.

@kangzj kangzj left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

One thing to catch while rebasing 👆 — otherwise this looks good.

* External dependencies
*/
import { jetpack } from '@jetpack-premium-analytics/icons';
import { Icon } from '@wordpress/ui';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Heads up: this will start failing lint once you rebase — #50964 landed on trunk and added a no-restricted-imports rule that blocks importing @wordpress/ui directly anywhere under packages/**. The idea is that a direct import compiles the whole library into this module's bundle again, which is the artifact-churn problem that tripped the wpcom size limit (WOOA7S-1836).

Easy fix though: @jetpack-premium-analytics/externals already re-exports Icon, so it's just

import { Icon } from '@jetpack-premium-analytics/externals';

While you're in there, packages/ui/package.json on trunk has dropped @wordpress/ui in favour of the externals workspace dep — worth keeping it that way when you resolve the conflicts rather than re-adding it.

@chihsuan chihsuan Aug 5, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Confirmed — I put the old import back temporarily and eslint does reject it, so this would have failed CI right after the rebase. Now importing Icon from @jetpack-premium-analytics/externals.

kangzj
kangzj previously approved these changes Aug 5, 2026

@kangzj kangzj left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approving ahead — once the rebase is done and the Icon import is switched to externals, feel free to merge. Tested locally at the current head: JS + PHP suites pass for both packages, and the breadcrumb behaviour matches the testing instructions.

The dashboard's root breadcrumb said "Analytics" while every report page's
said "Stats", so the product read as two names depending on the page. Both
now come from a shared StatsBreadcrumbs, which supplies the root crumb and
links it back to the dashboard, and a StatsPageIcon fills the page header's
visual slot with the Jetpack mark.

Refs WOOA7S-1784
wp-admin's `dd, li { margin-bottom: 6px }` reaches the breadcrumb list items,
so the trail measures 6px taller than its text. The header row centres that
taller box, leaving the title 3px above the mark beside it. Reset the item
margin from the trail's own wrapper.

Refs WOOA7S-1784
The beta runs both dashboards side by side, so the sidebar keeps the
v2 label to distinguish it from Jetpack Stats. Only the page header and
breadcrumbs read "Stats".
A direct `@wordpress/ui` import re-bundles the library into this module;
the no-restricted-imports rule added in #50964 rejects it.
@chihsuan
chihsuan force-pushed the echo/wooa7s-1784-stats-name branch from 7cc1e3b to 5cb93e6 Compare August 5, 2026 05:20
@chihsuan
chihsuan merged commit 3cb1731 into trunk Aug 5, 2026
87 checks passed
@chihsuan
chihsuan deleted the echo/wooa7s-1784-stats-name branch August 5, 2026 05:57
@github-actions github-actions Bot added [Status] UI Changes Add this to PRs that change the UI so documentation can be updated. and removed [Status] In Progress [Status] Needs Review This PR is ready for review. labels Aug 5, 2026
dognose24 added a commit that referenced this pull request Aug 6, 2026
…er width measurement track available space

The StatsBreadcrumbs wrapper is display:contents, so the route-level
':has(> nav)' workaround lands min-inline-size on a box-less element and
the crumb's min-content propagates again (regressed with #51022). Own
the constraint in the component: the wrapper's DOM parent and the nav —
the actual flex item — both get min-inline-size: 0, fixing every page
using StatsBreadcrumbs.

The date filter wrapper now grows into the header row's free space
instead of shrink-wrapping: a shrink-to-fit wrapper follows its own
content, so the panel's self-measurement could neither collapse when
narrow nor expand back when widened. The panel's contents right-align
per the mock.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
dognose24 added a commit that referenced this pull request Aug 6, 2026
…s own PR

With a fixed 360px basis the summary only got its basis plus half the
free space, so the title truncated while the filters wrapper hoarded an
empty gap. flex: 0 1 auto lets the title use the space it needs; the
wrapper still absorbs the leftover so the panel measurement keeps
tracking available space.

The StatsBreadcrumbs overflow fix moved to its own PR (#51085) — it is
a trunk regression from #51022 affecting every page, not parity scope.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
dognose24 added a commit that referenced this pull request Aug 7, 2026
…tents trail (#51085)

* Premium Analytics: fix the breadcrumb overflow behind the display:contents trail

The StatsBreadcrumbs wrapper is display:contents, so the route-level
':has(> nav)' workaround from #50970 lands min-inline-size on a box-less
element and the crumb's nowrap min-content propagates again, widening
the whole page into horizontal scrolling (regressed when #51022 swapped
the raw Breadcrumbs for StatsBreadcrumbs). Own the constraint in the
component: the wrapper's DOM parent and the nav — the actual flex item
in the box tree — both get min-inline-size: 0, fixing every page that
renders StatsBreadcrumbs.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Drop the superseded route-level breadcrumb workaround

The ':has(> nav)' rule targets the display:contents trail wrapper (no
box, so min-inline-size has nothing to act on) and the nav rule is
covered by the component-owned fix — StatsBreadcrumbs' stylesheet is
now the single source of the constraint.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Cite the upstream issue for the breadcrumbs slot propagation

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* ci: retrigger checks — workflow runs were never created for the previous push

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Docs [Package] Jetpack mu wpcom WordPress.com Features [Package] Premium Analytics [Status] UI Changes Add this to PRs that change the UI so documentation can be updated. [Tests] Includes Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants