-
Notifications
You must be signed in to change notification settings - Fork 291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve widget level Error Handler UI/UX for small widget areas #8939
Comments
IB ✔️ |
QA Update
|
@mohitwp Thank you for the observation. Yeah, I was trying to see if I can find a way around it to make it smaller, but couldn't fit it, as we need to show the error message, it is a bit longer than most content in the KM widgets, and making the font size smaller didn't help. So not sure we can do much about it, as this will catch the error within the widget, and if there is a problem, it will affect the functioning of the widget itself, showing the error, so layout being expanded a bit, doesn't seem much of priority, since fixing the issue would resolve that, and there is also a possibility error is temporary and on next visit it will be gone. as this will be shown only in very rare cases that one of the widgets actually encounter the error. You can potentially open a new issue, so we can see if any different decision can be made on this, or if it will be needed. |
QA Update ✅Thank you @zutigrm !
|
Feature Description
In #6695, we introduced an error boundary around the individual Widgets, this works well and prevents the whole dashboard from crashing if an Widget crashes due to error.
However, as pointed out by @aaemnnosttv in his comment, this should be improved to fit small widgets like Key Metrics tiles, and can be more user friendly.
Finally the error should be tracked differently, to distinguish from other dashboard. It would be great to be able to see which widget is crashing from the logs as well.
Originally, the ACs here recommended a new prop for the existing
ErrorHandler
component. But given the output and tracking would differ, a new component should be created instead 🙂Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
ErrorHandler
component should be replaced with a newWidgetErrorHandler
component atsite-kit-wp/assets/js/googlesitekit/widgets/components/WidgetAreaRenderer.js
Line 210 in dc89f6c
WIDGET_WIDTHS.QUARTER
widget.GoogleChartErrorHandler
component.trackEvent
call should use'widget_error'
instead of'react_error'
for the first argument.trackEvent
should be prefixed with the widget slug so it is easier to pinpoint which widget is causing errors.Implementation Brief
assets/js/components/WidgetErrorHandler
assets/js/components/GoogleChartErrorHandler/index.js
as a starting pointconsole.error
, useWidget error
for texttrackEvent
should usewidget_error
for event name, and usethis.props.slug
as a prefix to the current label (3rd parameter). Second parameter should stay the sameGoogle chart
with theWidget
in the description and title props ofCTA
componentgooglesitekit-googlechart-error-handler
class withgooglesitekit-widget-error-handler
assets/sass/widgets/_googlesitekit-widget-error-handler.scss
to apply any needed stylesassets/js/googlesitekit/widgets/components/WidgetAreaRenderer.js
ErrorHandler
withWidgetErrorHandler
and pass thewidget.slug
to the newslug
propTest Coverage
assets/js/components/GoogleChartErrorHandler/
as a starting pointQA Brief
tweak
for example):google-site-kit\/v1\/modules\/analytics-4\/data\/report\?metrics
GET
and200
for status codeThis will cause error widget in place for some widgets in the dashboard (like
Find out how your audience is growing
) and for some key metric widgets likeMost engaging pages
andTop pages by returning visitors
handle_mainDashboard_error
on main dashboard. Event category should bewidget_error
and label should include the widget slug prefix, examplekmAnalyticsTopReturningVisitorPages_An error occurred...
Changelog entry
The text was updated successfully, but these errors were encountered: