premium-analytics: Add device types pie chart to dashboard (mock data)#30
premium-analytics: Add device types pie chart to dashboard (mock data)#30dognose24 wants to merge 3 commits into
Conversation
Add PieChartUnresponsive with mock device-type data (Desktop/Mobile/Tablet) to the analytics dashboard. Unskip the hover/tooltip Playwright spec now that the chart is present. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
@copilot review |
|
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! |
|
@claude please review this PR. |
|
Claude finished @dognose24's task in 1m 5s —— View job PR Review
Overall this is a clean, well-scoped implementation that respects the Phase 1 boundary (UI-only, mock data). A couple of things worth addressing before merge: Issues1. Chart labels are not i18n-wrapped — Medium
// current
const DEVICE_TYPES: DataPointPercentage[] = [
{ label: 'Desktop', value: 5400 },
{ label: 'Mobile', value: 3800 },
{ label: 'Tablet', value: 800 },
];
// suggested
const DEVICE_TYPES: DataPointPercentage[] = [
{ label: __( 'Desktop', 'jetpack-premium-analytics' ), value: 5400 },
{ label: __( 'Mobile', 'jetpack-premium-analytics' ), value: 3800 },
{ label: __( 'Tablet', 'jetpack-premium-analytics' ), value: 800 },
];2. Duplicate
The import is in Looks Good
|
Address review: wrap 'Desktop', 'Mobile', 'Tablet' labels with __() Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Addressed review feedback: Issue #1 (i18n labels) — fixed in 33b445a. The Issue #2 (duplicate |
|
Claude finished @dognose24's task in 48s —— View job Re-review
Both issues from the previous review have been handled. Here's the verdict on each: Issue #1 — i18n labels: ✅ Fixed
Issue #2 — Duplicate The explanation holds up. In this pnpm workspace, Everything else looks good
This PR is ready to merge. No further changes needed. |
|
CI Note: The 'Check' workflow fails with 'token not supplied' — this is the |
Review Cycle SummaryRounds completed: 2 (kickoff + 1 review round) Addressed comments:
CI status: No required checks for this fork. One non-blocking failure: Resolved inline threads: 0 Unaddressed human reviewer comments: 0 AI re-review (round 3): ✅ Claude confirmed both issues resolved. "This PR is ready to merge." 🤖 Automated review cycle completed. Ready for human merge decision. |
There was a problem hiding this comment.
Pull request overview
Adds a mock “Device Types” pie chart to the Premium Analytics dashboard and enables the previously-placeholder Playwright coverage for chart tooltips/hover behavior.
Changes:
- Render
PieChartUnresponsiveon the dashboard with mock device-type data and tooltips enabled. - Add
@automattic/chartsas a dependency for the premium-analytics package and the dashboard route package. - Unskip the wp-verify Playwright spec covering pie-chart tooltip behavior.
Reviewed changes
Copilot reviewed 5 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tools/ai-sandbox/wp-verify/tests/pie-chart-tooltip.spec.ts | Unskips the pie-chart tooltip interaction Playwright spec. |
| projects/packages/premium-analytics/routes/dashboard/stage.tsx | Adds “Device Types” heading plus a fixed-size pie chart using mock data. |
| projects/packages/premium-analytics/routes/dashboard/package.json | Adds @automattic/charts dependency for the dashboard route bundle. |
| projects/packages/premium-analytics/package.json | Adds @automattic/charts dependency for the overall premium-analytics package build. |
| projects/packages/premium-analytics/changelog/add-premium-analytics-pie-chart | Adds a patch “added” changelog entry for the new dashboard chart. |
| pnpm-lock.yaml | Updates lockfile for the new workspace dependency (and associated metadata). |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (1)
tools/ai-sandbox/wp-verify/tests/pie-chart-tooltip.spec.ts:31
- Now that this suite is unskipped, the test name says the tooltip should include both the segment label and value, but the assertions only check for the label (Desktop/Mobile/Tablet). Either assert the expected value formatting as well, or rename the test to match what it actually verifies to avoid false confidence.
test.describe( 'Pie chart interactions', () => {
test( 'hover on a segment reveals tooltip with the segment label and value', async ( {
page,
} ) => {
await page.goto( ANALYTICS_URL );
| @@ -1,10 +1,20 @@ | |||
| import { PieChartUnresponsive, type DataPointPercentage } from '@automattic/charts'; | |||
…task skill Step 5's local-only regression injection leaves no durable trace by design — the post-revert filesystem state is identical whether Step 5 ran clean or was silently skipped. RSM-3269 / the dashboard-pie-chart sandbox run surfaced this: Step 5 actually ran correctly but PR #30 had no way to prove it; the only evidence lived in the agent's session log. This change closes the evidence gap: * Step 5 sub-step 8 — append a structured outcome block to `/tmp/dod-report.md` for each DoD item executed: edit applied, expected failing spec, actual failure observation, other specs status, revert + re-run summary. `/tmp/` location matches the RSM-3254 state-file pattern (outside `.claude/`, no commit pollution). * Step 8 — after push + PR open/update, if `/tmp/dod-report.md` exists post its contents as a PR comment under the `## DoD verification` heading, then delete the buffer. Reviewers see the verification result in the PR conversation thread. * HARD rule — Step 5 in scope without a corresponding `## DoD verification` comment = task failed. Forces agent to leave evidence; no longer optional. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Fixes #
Proposed changes
PieChartUnresponsivefrom@automattic/chartsto the Analytics dashboard with three mock device-type segments: Desktop (5400), Mobile (3800), Tablet (800)@automattic/chartsas a dependency to bothprojects/packages/premium-analytics/package.jsonandroutes/dashboard/package.jsonpie-chart-tooltip.spec.tsPlaywright spec (was a placeholder pending this chart landing)Related product discussion/links
Does this pull request change what data or activity we track or use?
No — mock data only, no tracking or data collection.
Testing instructions
wp-admin/admin.php?page=jetpack-premium-analyticsin a site with the premium-analytics plugin activeAutomated verification (wp-verify):
Agent Session Report
Screenshot