Skip to content

Premium Analytics: Add dashboard widget error handling#49657

Draft
nerrad wants to merge 12 commits into
update/pa-introduce-customize-dashboardfrom
add/WOOA7S-1553-dashboard-widget-error-handling
Draft

Premium Analytics: Add dashboard widget error handling#49657
nerrad wants to merge 12 commits into
update/pa-introduce-customize-dashboardfrom
add/WOOA7S-1553-dashboard-widget-error-handling

Conversation

@nerrad

@nerrad nerrad commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Why?

Recoverable widget data errors need a host-owned UI path instead of each widget inventing its own notice treatment. The dashboard already owns widget chrome, loading, and thrown-error boundaries, so it should also own the recoverable data-error surface exposed by widgets.

This likely belongs upstream in the dashboard/widget primitives work long term. This draft uses the Premium Analytics dashboard as a practical place to validate the contract and UI behavior with real widget data states before proposing the path upstream.

Proposed changes

  • Add a recoverable widget error contract to widget primitives and forward it through the dashboard renderer.
  • Render recoverable widget data errors in the dashboard widget chrome, including an optional action button.
  • Wrap Premium Analytics widget roots in the global error provider and keep useWidgetError() aligned with the dashboard chrome behavior.
  • Add basic Storybook coverage for the global error provider state and dashboard-hosted widget error rendering.

Related product discussion/links

  • N/A

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

No.

Testing instructions

  • Use Node 24.15.0 or later in the supported 24.x range. For example, with nvm: nvm use 24.15.0.
  • Run pnpm --filter @automattic/jetpack-storybook storybook:build.
  • In Storybook, check Packages/Premium Analytics/Data/Providers/GlobalErrorProvider.
  • In Storybook, check Packages/Premium Analytics/Widgets Toolkit/DashboardWidgetError.

@github-actions

github-actions Bot commented Jun 16, 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!

@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 Jun 16, 2026
@jp-launch-control

jp-launch-control Bot commented Jun 16, 2026

Copy link
Copy Markdown

Code Coverage Summary

No summary data is available for parent commit 7ff7f71, 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 7ff7f71 is available.

Full summary · PHP report


const ERROR_TYPES: Exclude< GlobalErrorType, null >[] = [ 'network', 'auth', 'server' ];

const panelStyle: CSSProperties = {

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.

Odd that the story requires this much CSS 🤔

retrofox added 8 commits June 17, 2026 07:07
Private, source-consumed copy of @wordpress/grid until core publishes it.
Private, source-consumed copy of @wordpress/widget-primitives until core publishes it.
Private, source-consumed dashboard engine; depends on jetpack-widget-primitives and jetpack-grid.
Renders the WidgetDashboard engine via wp-build, bundling the grid/primitives/dashboard packages.
useWidgetTypes drives discovery via /wp/v2/widget-modules; hello-world builds as a lazy-loaded script module.
Hook the page boot-dependencies filter so widget modules reach the import map; move the endpoint to the jetpack/v4 namespace.
@wordpress/grid and widget-primitives references in widget-dashboard JSDoc/comments/README, per the faithful-source sync policy.
@nerrad nerrad force-pushed the update/pa-introduce-customize-dashboard branch from 5bb6dd9 to 7ff7f71 Compare June 17, 2026 11:19
@nerrad nerrad force-pushed the add/WOOA7S-1553-dashboard-widget-error-handling branch from da9047c to 31f0b7f Compare June 17, 2026 11:19
@nerrad nerrad force-pushed the add/WOOA7S-1553-dashboard-widget-error-handling branch from 31f0b7f to da58724 Compare June 17, 2026 17:18
@nerrad nerrad force-pushed the add/WOOA7S-1553-dashboard-widget-error-handling branch from da58724 to d59f402 Compare June 17, 2026 17:25
@louwie17 louwie17 force-pushed the update/pa-introduce-customize-dashboard branch from 7ff7f71 to 22e10a7 Compare June 19, 2026 12:21
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.

2 participants