Premium Analytics: add the shared report-page framework components#50170
Draft
Nikschavan wants to merge 1 commit into
Draft
Premium Analytics: add the shared report-page framework components#50170Nikschavan wants to merge 1 commit into
Nikschavan wants to merge 1 commit into
Conversation
Add the widgets-toolkit primitives every second-level module report page composes (WOOA7S-1614 / WOOA7S-1620): - ReportPageLayout + ReportPageSection: breadcrumb header with actions slot, optional internal tabs, filters row, and bordered section cards. - ReportPerformanceChart: the multi-metric visits chart (Views, Visitors, Comments, Likes) with a metric show/hide menu, the page-owned day/week/month interval selector, a collapse toggle, and a dashed previous-period overlay when a single metric is visible. - ReportRecordsTable: a Core DataViews table over the module's summarized rows; search, sorting, column config, and pagination run client-side via filterSortAndPaginate. Components receive data as props; pages own the hooks and reportParams. Also exports IntervalType from the data package root.
Contributor
|
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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of WOOA7S-1614 / WOOA7S-1620
Proposed changes
Add the
widgets-toolkitprimitives that every second-level "view all" report page composes. A module report page is assembled by passing its data hook results and DataViews field config — composition, not a bespoke page per module (see the folder README for the usage sketch).ReportPageLayout+ReportPageSection— the page scaffold: breadcrumbs/description/actions slots, an optional internal-tabs slot, a filters row, and bordered section cards.ReportPerformanceChart— the performance chart section: metrics drawn viaComparativeLineChart, a metric show/hide menu, the day/week/month interval selector (owned by the page — it changes the query), a collapse toggle, and a dashed previous-period overlay when a single metric is visible (buildReportMetricSeries, unit-tested). It imports@automattic/charts/style.cssitself: widgets get those styles throughWidgetRoot, report pages render charts without one — without the stylesheet the chart's layout constraints are missing and the svg grows unbounded.ReportRecordsTable— a Core DataViews table (first realDataViewsuse in the package) over the module's rows: search, sortable + configurable columns, and pagination run client-side viafilterSortAndPaginate. Seedsview.fields(DataViews renders no columns otherwise) and includes the CSS to embed DataViews in an auto-height card (its layout container is a zero-basis flex child built for fixed-height parents).Components receive data as props — pages own the hooks and the
reportParamsderived from the URL. Also exportsIntervalTypefrom the data package root.The first consumer (the Posts & Pages report page, WOOA7S-1620) is stacked on this PR: #50171
Related product discussion/links
Out of scope, tracked separately: the Download/CSV action (no Stats export path exists yet) and additional per-post metrics columns (needs new WPCOM data).
Does this pull request change what data or activity we track or use?
No.
Testing instructions
cd projects/js-packages/storybook && pnpm run storybook:dev) and open Packages/Premium Analytics/Widgets Toolkit/Components/ReportPage.pnpm run typecheck,pnpm run test(includes thebuildReportMetricSeriessuite), eslint/stylelint on the changed files — all clean.