Premium Analytics: rename to “Stats” and add the Jetpack logo - #51022
Conversation
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
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:
If you have questions about anything, reach out in #jetpack-developers for guidance! |
Code Coverage SummaryCoverage changed in 16 files. Only the first 5 are listed here.
5 files are newly checked for coverage.
|
7ba286b to
1307b83
Compare
| // 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' ), |
There was a problem hiding this comment.
We probably don't want to change this?
There was a problem hiding this comment.
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' ); |
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
One thing to catch while rebasing 👆 — otherwise this looks good.
| * External dependencies | ||
| */ | ||
| import { jetpack } from '@jetpack-premium-analytics/icons'; | ||
| import { Icon } from '@wordpress/ui'; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
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.
7cc1e3b to
5cb93e6
Compare
…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>
…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>
…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>
Fixes WOOA7S-1784
Proposed changes
"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.StatsBreadcrumbsthat 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'sh1.StatsPageIconthat displays the Jetpack mark on the dashboard and every report and detail page.iconspackage, avoiding a new dependency.Breadcrumbsexposes 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
?page=jetpack-premium-analytics-wp-admin.h1should be "Stats" rather than "Analytics".?preset=last-30-days.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