site-kit-wp: Ad Blocking Recovery Setup page appears broken and confusing when user visits the page after completing setup

Bug Description

As observed and described by @aaemnnosttv,

If an user navigates back after completing the setup, or otherwise directly navigates to the ABR setup screen after set up is complete, the interface appears somewhat broken because there is no action to go forward or status. Perhaps most significantly is that clicking Cancel at this point will actually reset/deactivate/undo the feature’s set up.

Screenshots

image

Steps to reproduce

  1. Go back after setting up Ad Blocking Recovery.
  2. Or, visit /wp-admin/admin.php?page=googlesitekit-ad-blocking-recovery

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

Acceptance criteria

  • If the Ad Blocking Recovery Setup page is directly navigated to or returned to via the browser’s back button after the setup is complete, it should display the state which is mocked up here:

image

  • Both of the steps should be marked as complete, i.e. they should display the tick in the circle as per the mockup.
  • The styling of the text should follow that in the existing Step 2 - After CTA Click view.
  • The CTAs in the footer should have the same behaviour as the same CTAs in the Step 2 - After CTA Click view:
    • The primary My message is ready CTA should return to the dashboard, showing the ad_blocking_recovery_setup_success notification.
    • The Create message link should open the AdSense Ad Blocking Recovery page in a new tab i.e. https://www.google.com/adsense/new/u/0/pub-XXXXX/privacymessaging/ad_blocking?pli=1, where pub-XXXXX is the AdSense account ID.

Implementation Brief

Test Coverage

  • Remove the test for the cancel link click for the final step.
  • Fix all other tests for the final step.
  • Add a story/VRT test for the “completed” state

QA Brief

Changelog entry

About this issue

Most upvoted comments

@aaemnnosttv can we know that setup is completed at this stage? If we can, then showing a changed CTA would be indeed the best option. Given the limitations of the API right now, my understanding is we can’t know this, so I’d suggest showing the screen with both “My message is ready” and “Create message”. If the user did click the back button for whatever reason, then seeing the same screen as before would also not be a surprising experience.