site-kit-wp icon indicating copy to clipboard operation
site-kit-wp copied to clipboard

Register new widget with highest priority to render the notification in the key metrics widget area

Open 10upsimon opened this issue 1 year ago • 7 comments

Feature Description

As part of the ongoing work within the ACR epic is the need to surface subtle notification style banner within the KMW widget area, but not replacing said KMW cards.

Refer to the Subtle banner notification for detected events section of the design doc

The below screenshot shows an example of said inline banner being rendered between the widget area title and the widget area contents:

image.png

Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

  • Register a new widget to the key metrics widget area
    • It should be having highest priority
    • It should be displayed as full width widget
    • For now it can render null, this will be replaced by notification in #9371

Implementation Brief

  • [ ] Update assets/js/googlesitekit/widgets/register-defaults.js
    • Register new widget under AREA_MAIN_DASHBOARD_KEY_METRICS_PRIMARY widget area
    • You can use keyMetricsEventDetectionCalloutNotification for the widget slug
    • For width use widgetsAPI.WIDGET_WIDTHS.FULL
    • For priority use 0
    • For modules include analytics-4
    • In isActive check, if conversionReporting feature flag is disabled, return early. And you can also return false by default for now
    • Use null for component, this will be added in #9371

Test Coverage

  • No updates needed

QA Brief

  • No QA needed as there is no user-facing change here.

Changelog entry

  • N/A

10upsimon avatar Sep 12 '24 10:09 10upsimon

@10upsimon @zutigrm how about registering a new full width widget with the highest priority that will render that notification instead of introducing a new property to the widgets API? Adding new subHeader feels excessive since we already have subTitle there.

eugene-manuilov avatar Sep 25 '24 20:09 eugene-manuilov

@eugene-manuilov That's a good point, thanks. With new changes to the layout, to expand selection to 8 items which also adjusts some styling to allow for KMW taking proper sizes, this would work as intended. I will update dependency and modify the approach.

zutigrm avatar Sep 26 '24 12:09 zutigrm

Thanks, @zutigrm. AC ✔️

eugene-manuilov avatar Sep 26 '24 13:09 eugene-manuilov

@zutigrm IB ✅ moving to EB

10upsimon avatar Oct 01 '24 14:10 10upsimon

Moved to Approval since there is nothing to QA here.

eugene-manuilov avatar Oct 20 '24 08:10 eugene-manuilov

Moving it back to execution, since it breaks the dashboard (when conversionReporting feature flag is enabled), it seems Component prop has to contain component, null is throwing invariant error. I will quickly replace this with WidgetNull and send it to CR

cc: @eugene-manuilov @tofumatt

zutigrm avatar Oct 21 '24 09:10 zutigrm

Thanks, merged. Moving back to Approval.

eugene-manuilov avatar Oct 21 '24 10:10 eugene-manuilov