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

Scroll to the Audiences Widget Area from the Setup Success Notice

Open techanvil opened this issue 1 year ago • 2 comments

Feature Description

Clicking on the Setup Success Notice's "Show me" CTA should scroll to the Audiences Widget Area.

image


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

Acceptance criteria

  • Upon clicking the "Show me" CTA on the Setup Success Notice, the page should scroll to the Audiences Widget Area, and the notice should be dismissed for the current user.

Implementation Brief

Note: see the IB for #8172, we may be able to refactor/reuse the corresponding code.

  • [ ] Update the scrollToWidgetArea function in assets/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSegmentationSetupSuccessSubtleNotification.js: https://github.com/google/site-kit-wp/blob/e12d144418423b637879d8dd0f0d181acaa89b1b/assets/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSegmentationSetupSuccessSubtleNotification.js#L65-L70
    • [ ] Use getContextScrollTop to get the y offset for the class .googlesitekit-widget-area--mainDashboardTrafficAudienceSegmentation.
    • [ ] Use global.scrollTo with top set to the value of getContextScrollTop and the behaviour set to smooth.
    • [ ] Account for any layout shift due to the notification being dismissed with dismissNotificationForUser in this function.

Test Coverage

  • No additional test coverage required.

QA Brief

Changelog entry

techanvil avatar Jun 14 '24 14:06 techanvil

I created an IB, should we consider dismissing the notification after the user clicks "Show Me"?

benbowler avatar Jun 27 '24 08:06 benbowler

Thanks @benbowler, yes, the intention is to dismiss the notification as well (i.e. maintain the current behaviour). I've updated the AC to make it clearer.

IB :white_check_mark:

techanvil avatar Jun 27 '24 09:06 techanvil

QA Update ✅

Upon clicking the "Show me" CTA on the Setup Success Notice, the page scrolls to the Audiences Widget Area, and the notice is dismissed for the current user.

Moving ticket to Approval.

Desktop test:

https://github.com/user-attachments/assets/75fc988e-8ca0-4fdd-b33c-3c1c6607d19e

Mobile test:

https://github.com/user-attachments/assets/bac64cff-cf22-4742-b9d2-6fbaca06204e

kelvinballoo avatar Sep 17 '24 19:09 kelvinballoo