Premium Analytics: Cover Top Platforms dimension in stories - #50328
Conversation
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>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
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 SummaryThis 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. 🤷 |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
🤖 Review-cycle summary —
|
| 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.
There was a problem hiding this comment.
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
platformDimensionStorybook control (browser/platform) to the Top Platforms close-up stories and the widget dashboard story. - Introduce a new
ByOSstory 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. |
Follow-up to #50251.
Proposed changes
platformDimensiontoolbar attribute (relevance: 'high') as a Storybook control on the close-up and dashboard stories, and add a dedicatedByOSstory — 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.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
projects/packages/premium-analytics:pnpm run typecheck.pnpm run storybook:devfromprojects/js-packages/storybook) and openPackages/Premium Analytics/Widgets/TopPlatforms.platformDimensionradio control (browser / platform) appears on the Default, WithComparison, and WidgetDashboardWithWidget stories and switches the leaderboard between Browser and OS rows.ByOSstory renders the OS leaderboard.