Skip to content

Premium Analytics: post detail parity — overflow fixes, inline date presets, no comparison - #50971

Merged
dognose24 merged 11 commits into
trunkfrom
update/wooa7s-1785-post-detail-parity
Aug 7, 2026
Merged

Premium Analytics: post detail parity — overflow fixes, inline date presets, no comparison#50971
dognose24 merged 11 commits into
trunkfrom
update/wooa7s-1785-post-detail-parity

Conversation

@dognose24

@dognose24 dognose24 commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Part of WOOA7S-1785 · Based on trunk (no longer stacked on #50970 — nothing here depends on it after the rescope below)

Why

Applies to the post/email detail page everything proven out on the video detail page (#50970): the overflow bugs found by live debugging, the timezone day-shift, and the mock's inline date presets without a comparison control.

Proposed changes

Testing

  • pnpm test in projects/packages/premium-analytics — 1622 tests green, including the new UTC-12 bucket regression test and the no-comparison assertions.
  • On a site in a negative-offset timezone (e.g. UTC-12), the post detail views chart buckets no longer shift a day.
  • Post/email detail: the date filters bar shows no Compare control and the widgets render no comparison series; comparison params in the URL are preserved and carried back to the dashboard via the breadcrumb.
  • A post with a long unbroken title no longer forces horizontal scroll from the summary card (the breadcrumb crumb's half of that fix is Premium Analytics: fix the breadcrumb overflow behind the display:contents trail #51085 — until it merges, the crumb still overflows on this branch); the featured image keeps its square ratio.

Screenshots

Date filter on desktop

截圖 2026-08-07 凌晨3 24 28 截圖 2026-08-07 凌晨3 24 42

Wrapped date filter on mobile

截圖 2026-08-07 凌晨3 24 54

@github-actions

github-actions Bot commented Jul 31, 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 update/wooa7s-1785-post-detail-parity branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack update/wooa7s-1785-post-detail-parity
bin/jetpack-downloader test jetpack-mu-wpcom-plugin update/wooa7s-1785-post-detail-parity

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 Jul 31, 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 🤖


🔴 Action required: Please include detailed testing steps, explaining how to test your change, like so:

## Testing instructions:

* Go to '..'
*

🔴 Action required: We would recommend that you add a section to the PR description to specify whether this PR includes any changes to data or privacy, like so:

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

My PR adds *x* and *y*.

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!

@github-actions github-actions Bot added the [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. label Jul 31, 2026
@jp-launch-control

jp-launch-control Bot commented Jul 31, 2026

Copy link
Copy Markdown

Code Coverage Summary

No summary data is available for parent commit 844736f, so cannot calculate coverage changes. 😴

If that commit is a feature branch rather than a trunk commit, this is expected. Otherwise, this should be updated once coverage for 844736f is available.

Full summary · PHP report · JS report

@dognose24
dognose24 force-pushed the update/wooa7s-1785-post-detail-parity branch from 7b10fb9 to ed03ae3 Compare August 2, 2026 16:28
…comparison

Applies to the post/email detail page the fixes proven on the video
detail page: the breadcrumb/summary overflow bugs (contain: inline-size
plus the breadcrumbs-slot shrink shim), aspect-ratio: 1 so the boot
shell's img reset cannot squash the featured image, post-views bucket
keys parsed as site-local calendar dates (parseSiteDateTime, UTC-12
regression test), and block-size nits.

The page's design has no period-over-period comparison: the post-views
and email-time-series widgets drop their comparison series, the route
normalizes comparison params away, and DateFiltersPanel gains a minimal
showComparison prop so the Compare control hides at the existing
fixed-bar call site.

Moving the panel onto the summary's title row (per the mock) is
deferred until the preset measurement rework lands (WOOA7S-1816) — it
would collide head-on, the same reason the video-detail PR dropped its
filters row. Rebased onto trunk accordingly: nothing here depends on
the video-detail branch anymore.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@dognose24
dognose24 force-pushed the update/wooa7s-1785-post-detail-parity branch from ed03ae3 to 9ee2ef7 Compare August 3, 2026 18:51
@dognose24
dognose24 changed the base branch from update/wooa7s-1785-video-detail-composition to trunk August 3, 2026 18:51
dognose24 and others added 3 commits August 4, 2026 15:22
Mirror the video-detail review outcome (#50970): the page renders no
comparison and its widgets ignore the params, but the breadcrumb's
dashboard link reads the URL state back out, so stripping them lost the
user's comparison settings on a Dashboard → Post → Dashboard round trip.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ost-detail-parity

# Conflicts:
#	projects/packages/premium-analytics/packages/ui/src/date-filters-panel/date-filters-panel.tsx
#	projects/packages/premium-analytics/routes/post-detail/package.json
#	projects/packages/premium-analytics/routes/post-detail/stage.tsx
@dognose24
dognose24 marked this pull request as ready for review August 5, 2026 23:49
@dognose24
dognose24 requested review from a team as code owners August 5, 2026 23:49
@dognose24 dognose24 self-assigned this Aug 6, 2026
@dognose24 dognose24 added [Status] Needs Review This PR is ready for review. [Status] UI Changes Add this to PRs that change the UI so documentation can be updated. and removed [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. [Status] In Progress labels Aug 6, 2026
@github-actions github-actions Bot added [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. and removed [Status] Needs Review This PR is ready for review. labels Aug 6, 2026

@chihsuan chihsuan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @dognose24

I noticed UTM and highlights are still rendering comparison data. I wonder if it's possible to preserve the URL for the breadcrumb round trip, but remove comp/compare_* from the reportParams injected into every widget in this page’s layout? That would make the page-wide invariant hold by construction.

Image

// as UTC midnight and read as the previous day on negative-offset sites).
return buckets.map( bucket => ( {
date: localTZDate( bucket.date ),
date: parseSiteDateTime( bucket.date ) ?? parseISO( bucket.date ),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could we remove this fallback instead of allowing it to produce the wrong instant?

bucket.date is generated with format(start, 'yyyy-MM-dd'), so parseSiteDateTime() should always succeed here. If it ever does not, parseISO(bucket.date) parses browser-local midnight rather than site-local midnight, reintroducing the day-shift bug this change fixes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 10fc2e2 — dropped the fallback. bucket.date comes from format( start, 'yyyy-MM-dd' ) so parseSiteDateTime() can't fail in practice; if it ever does, the point is now dropped (flatMap) rather than re-anchored to a browser-local instant that would reintroduce the day shift.

dognose24 and others added 2 commits August 6, 2026 13:03
…ost-detail-parity

# Conflicts:
#	projects/packages/premium-analytics/routes/post-detail/stage.test.tsx
…e parseISO fallback

Per review: the page-wide no-comparison invariant now holds by
construction — usePostDetailTabs injects comparison-stripped
reportParams (via the new omitComparisonReportParams helper) into every
layout entry, so comparison-capable widgets like UTM insights and
highlights can no longer render deltas from URL state. The URL keeps
the comparison params for the breadcrumb round trip.

Also remove the parseISO fallback in use-post-views: bucket dates come
from format(start, 'yyyy-MM-dd') so parseSiteDateTime cannot fail, and
the fallback would silently reintroduce the browser-local day shift;
an unparseable bucket now drops the point instead.

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

dognose24 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @chihsuan! Adopted your suggestion in 10fc2e2 — the invariant now holds by construction. usePostDetailTabs injects comparison-stripped reportParams (via a new omitComparisonReportParams() helper in the routing package) into every layout entry, so WidgetRoot takes the attributes branch instead of falling back to the raw URL search. UTM insights and highlights no longer render deltas, while the URL keeps comp/compare_* for the breadcrumb round trip. Covered by a hook test asserting every layout entry's reportParams carries the window and post_id but none of the comparison keys.

截圖 2026-08-06 下午1 47 24

The video detail page (#50970) uses the same widgets-ignore approach — I'll port this construction there as a follow-up.

The npm registry marked crypto-js@4.2.0 deprecated after this lock was
written, so the lock check's fresh resolution now expects the
deprecation note. Registry-metadata drift only; no dependency change.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@dognose24 dognose24 removed the [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. label Aug 6, 2026
@dognose24 dognose24 added the [Status] Needs Review This PR is ready for review. label Aug 6, 2026
@dognose24
dognose24 requested a review from chihsuan August 6, 2026 05:52
@github-actions github-actions Bot added [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. and removed [Status] Needs Review This PR is ready for review. labels Aug 6, 2026
@dognose24 dognose24 added [Status] Needs Review This PR is ready for review. and removed [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. labels Aug 6, 2026
@github-actions github-actions Bot added [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. and removed [Status] Needs Review This PR is ready for review. labels Aug 6, 2026
chihsuan
chihsuan previously approved these changes Aug 6, 2026

@chihsuan chihsuan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks @dognose24 Looks good. 🚢

@dognose24

dognose24 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

A note on the current shape of this branch since your last review: it is the state you reviewed, plus your two notes addressed (comparison stripped from the injected reportParams via omitComparisonReportParams(), parseISO fallback dropped), a one-line pnpm-lock refresh for the crypto-js deprecation flag, and one commit (b67f72b) that puts the date filter presets on the summary's title row per the design mocks — title left, presets right, 400px summary floor.

No shared-component changes beyond the already-reviewed showComparison prop: the panel keeps measuring itself, which in this shrink-to-fit slot always sees its own content width — so the presets stay in their full layout and narrow rows degrade poorly. That is a known, accepted rough edge here; the external-measurement wiring (containerElement / reservedInlineSize) ships as a follow-up in #51088. The breadcrumb overflow fix lives in #51085.

@dognose24 dognose24 added [Status] Needs Review This PR is ready for review. and removed [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. labels Aug 6, 2026
One header row per the design mocks: title left, presets right,
vertically centered. The summary grows into free space and absorbs the
squeeze down to a 400px floor (title ellipsis); its inline-size
containment keeps a long title from wrapping the row.

Known rough edge, deferred to #51088: the panel self-measures its root,
which in this shrink-to-fit slot always sees its own content width — so
the presets keep their full layout and narrow rows degrade poorly. The
external-measurement wiring (containerElement / reservedInlineSize)
ships there to keep this PR free of shared-component changes beyond the
already-reviewed showComparison prop.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Superseded by #51085: the ':has(> nav)' rule targets StatsBreadcrumbs'
display:contents trail wrapper (no box for min-inline-size to act on)
and the nav rule is covered by the component stylesheet. Tracked
upstream as WordPress/gutenberg#81297.

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

@chihsuan chihsuan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🚢

@github-actions github-actions Bot added [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. and removed [Status] Needs Review This PR is ready for review. labels Aug 7, 2026
@dognose24
dognose24 merged commit 7207172 into trunk Aug 7, 2026
79 of 80 checks passed
@dognose24
dognose24 deleted the update/wooa7s-1785-post-detail-parity branch August 7, 2026 07:06
@github-actions github-actions Bot removed the [Status] Needs Author Reply We need more details from you. This label will be auto-added until the PR meets all requirements. label Aug 7, 2026
dognose24 added a commit that referenced this pull request Aug 7, 2026
…mparison from its widgets (#51082)

* Premium Analytics: post detail parity — overflow fixes, timezone, no comparison

Applies to the post/email detail page the fixes proven on the video
detail page: the breadcrumb/summary overflow bugs (contain: inline-size
plus the breadcrumbs-slot shrink shim), aspect-ratio: 1 so the boot
shell's img reset cannot squash the featured image, post-views bucket
keys parsed as site-local calendar dates (parseSiteDateTime, UTC-12
regression test), and block-size nits.

The page's design has no period-over-period comparison: the post-views
and email-time-series widgets drop their comparison series, the route
normalizes comparison params away, and DateFiltersPanel gains a minimal
showComparison prop so the Compare control hides at the existing
fixed-bar call site.

Moving the panel onto the summary's title row (per the mock) is
deferred until the preset measurement rework lands (WOOA7S-1816) — it
would collide head-on, the same reason the video-detail PR dropped its
filters row. Rebased onto trunk accordingly: nothing here depends on
the video-detail branch anymore.

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

* Pass comparison params through the post-detail route

Mirror the video-detail review outcome (#50970): the page renders no
comparison and its widgets ignore the params, but the breadcrumb's
dashboard link reads the URL state back out, so stripping them lost the
user's comparison settings on a Dashboard → Post → Dashboard round trip.

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

* Premium Analytics: align comparison pass-through comments with the route contract

* Strip comparison params from injected widget reportParams and drop the parseISO fallback

Per review: the page-wide no-comparison invariant now holds by
construction — usePostDetailTabs injects comparison-stripped
reportParams (via the new omitComparisonReportParams helper) into every
layout entry, so comparison-capable widgets like UTM insights and
highlights can no longer render deltas from URL state. The URL keeps
the comparison params for the breadcrumb round trip.

Also remove the parseISO fallback in use-post-views: bucket dates come
from format(start, 'yyyy-MM-dd') so parseSiteDateTime cannot fail, and
the fallback would silently reintroduce the browser-local day shift;
an unparseable bucket now drops the point instead.

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

* Premium Analytics: restore the video detail date filters and strip comparison from its widgets

WOOA7S-1816: the date filter presets were dropped from the video detail
page in #50970 because they collided with the preset-measurement rework;
now that #50906 has landed, restore them using the same construction as
post detail (DateFiltersPanel with showComparison=false, fixed above the
scroll container).

Also port the comparison-strip construction from #50971: inject
omitComparisonReportParams()-stripped reportParams into every layout
entry so comparison-capable widgets (highlights) cannot render deltas
from URL state, while the URL keeps the params for the breadcrumb round
trip.

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

* Record the crypto-js deprecation in pnpm-lock.yaml

The npm registry marked crypto-js@4.2.0 deprecated after this lock was
written, so the lock check's fresh resolution now expects the
deprecation note. Registry-metadata drift only; no dependency change.

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

* Clarify that the video detail comparison strip is defensive

All three current video-detail widgets already ignore comparison params
in their own query mapping; the injection exists so the page-wide
invariant holds by construction (matching post detail) rather than
relying on each widget. Adjust the code comment and changelog wording
accordingly.

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

* Put the date filter presets on the summary title row per the mocks

One header row per the design mocks: title left, presets right,
vertically centered. The summary grows into free space and absorbs the
squeeze down to a 400px floor (title ellipsis); its inline-size
containment keeps a long title from wrapping the row.

Known rough edge, deferred to #51088: the panel self-measures its root,
which in this shrink-to-fit slot always sees its own content width — so
the presets keep their full layout and narrow rows degrade poorly. The
external-measurement wiring (containerElement / reservedInlineSize)
ships there to keep this PR free of shared-component changes beyond the
already-reviewed showComparison prop.

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

* Put the video detail date filter presets on the summary title row

Same composition as post detail: one header row, title left and presets
right, 400px summary floor with inline-size containment. The panel's
step-down on narrow rows needs external measurement and ships
separately (#51088).

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

* Drop the route-level breadcrumb shim in favor of the component-owned fix

Superseded by #51085: the ':has(> nav)' rule targets StatsBreadcrumbs'
display:contents trail wrapper (no box for min-inline-size to act on)
and the nav rule is covered by the component stylesheet. Tracked
upstream as WordPress/gutenberg#81297.

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

* Drop the video detail route-level breadcrumb shim in favor of #51085

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

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

* 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

[Package] Premium Analytics [Status] UI Changes Add this to PRs that change the UI so documentation can be updated.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants