Skip to content

Premium Analytics: Cover Top Platforms dimension in stories - #50328

Merged
dognose24 merged 2 commits into
trunkfrom
codex/align-control-widget-stories
Jul 9, 2026
Merged

Premium Analytics: Cover Top Platforms dimension in stories#50328
dognose24 merged 2 commits into
trunkfrom
codex/align-control-widget-stories

Conversation

@dognose24

Copy link
Copy Markdown
Contributor

Follow-up to #50251.

Proposed changes

  • Expose the Top Platforms platformDimension toolbar attribute (relevance: 'high') as a Storybook control on the close-up and dashboard stories, and add a dedicated ByOS story — the only default-layout widget with a host toolbar control whose dimension had no story coverage. This matches the Locations (geoGranularity) and UTM Insights (ByCampaign) story patterns.
  • Update the story docs description, which still said the dimension is "switched via a runtime dropdown in the widget body" — it has been a widget-host toolbar control since the attribute promotion.

Related product discussion/links

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

No. Storybook-only changes; no runtime code is touched.

Testing instructions

  • From projects/packages/premium-analytics: pnpm run typecheck.
  • Run Storybook (pnpm run storybook:dev from projects/js-packages/storybook) and open Packages/Premium Analytics/Widgets/TopPlatforms.
  • Confirm the platformDimension radio control (browser / platform) appears on the Default, WithComparison, and WidgetDashboardWithWidget stories and switches the leaderboard between Browser and OS rows.
  • Confirm the new ByOS story renders the OS leaderboard.

Expose the platformDimension toolbar attribute as a Storybook control
with a dedicated ByOS story, matching the Locations/UTM Insights story
pattern, and update the stale body-dropdown wording in the story docs.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@dognose24
dognose24 requested review from a team as code owners July 8, 2026 16:01
@dognose24 dognose24 added the [Status] Needs Review This PR is ready for review. label Jul 8, 2026
@dognose24 dognose24 self-assigned this Jul 8, 2026
@dognose24 dognose24 added [Status] In Progress and removed [Status] Needs Review This PR is ready for review. labels Jul 8, 2026
@dognose24

This comment has been minimized.

@claude

This comment has been minimized.

@github-actions

github-actions Bot commented Jul 8, 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!

@jp-launch-control

Copy link
Copy Markdown

Code Coverage Summary

This PR did not change code coverage!

That could be good or bad, depending on the situation. Everything covered before, and still is? Great! Nothing was covered before? Not so great. 🤷

Full summary · PHP report

@dognose24

This comment has been minimized.

@dognose24

This comment has been minimized.

@claude

This comment has been minimized.

@dognose24

Copy link
Copy Markdown
Contributor Author

🤖 Review-cycle summary — 9dd3b4b7a6349614

3 rounds; CI green; 1 AI review addressed (claude[bot] LGTM on re-review); no human comments pending.

What changed during the cycle

Commits added:

  • a63496147f — Address review: render host toolbar control in dashboard story

Review threads addressed:

Source Comment Resolution
claude[bot] (#4916743597) storyWidgetType omitted attributes/example, so the dashboard story didn't render the real host "View by" toolbar control Added both fields + WidgetType import, matching the Locations story (a63496147f); confirmed LGTM on re-review

Unaddressed (flagged for owner):
None.

CI: all required checks passing (mergeStateStatus: CLEAN). pnpm run typecheck was run locally before each push and passed.

One manual check suggested by review: open the WidgetDashboardWithWidget story in Storybook and confirm the "View by" dropdown now appears in the widget header.

@dognose24 dognose24 added [Status] Needs Team Review Obsolete. Use Needs Review instead. and removed [Status] In Progress labels Jul 8, 2026
@dognose24
dognose24 requested a review from Copilot July 9, 2026 01:38

Copilot AI 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.

Pull request overview

This PR improves Storybook coverage for the Premium Analytics “Top Platforms” widget by exposing its host-toolbar platformDimension attribute as a Storybook control and adding a dedicated OS-focused story, aligning it with existing widget story patterns (e.g., Locations).

Changes:

  • Add a platformDimension Storybook control (browser/platform) to the Top Platforms close-up stories and the widget dashboard story.
  • Introduce a new ByOS story to explicitly cover the OS (“platform”) dimension.
  • Update the Storybook docs description to reflect that the active dimension is controlled via the widget-host toolbar attribute.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
projects/packages/premium-analytics/widgets/top-platforms/stories/top-platforms-widget.stories.tsx Adds platformDimension controls, wires attributes through a shared helper, and adds a ByOS story + updated docs description.
projects/packages/premium-analytics/changelog/align-control-widget-stories Adds a changelog entry noting the added Storybook coverage.

Significance: patch
Type: changed

Cover the Top Platforms browser/OS toolbar dimension in Storybook.

@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.

LGTM! 🚢

@dognose24
dognose24 merged commit 053f474 into trunk Jul 9, 2026
78 checks passed
@dognose24
dognose24 deleted the codex/align-control-widget-stories branch July 9, 2026 03:38
@github-actions github-actions Bot removed the [Status] Needs Team Review Obsolete. Use Needs Review instead. label Jul 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants