Closed techanvil closed 11 months ago
@techanvil I wonder if we should instead consider taking a similar approach as we have in other places lately where the component becomes ghosted/disabled with a spinner in the submit button? That seems like it would be a bit simpler and result in a more stable experience even if there was a "flicker" of state. Probably a question for UX but I think that would be preferable.
Good question, @aaemnnosttv. I've moved this back to AC, tagging @sebastianmantel for UX input on this one...
Update: Sigal has replied to the above question on the Slack UX channel as follows:
I took a look at the github issue and I agree with @aaemnnosttv that a spinner within the CTA button is preferable here as it appears before we change the view completely. The current loading state that flickers is suitable when displayed within the page that will actually load.
AC LGTM 👍
Hi @hussain-t, this IB is looking good.
One question - for the AdSense Setup form, instead of adding the new savingAdsenseSiteAdded
state property, could we simply remove the checks for isDoingSubmitChanges
and isNavigating
from the condition for showing the ProgressBar
in assets/js/modules/adsense/components/setup/utils.js
? This would be preferable if so, but maybe you've explored this and it's not viable for some reason.
Hi @techanvil, thanks for your feedback.
I did consider removing the isDoingSubmitChanges
and isNavigating
checks from the condition; however, this approach led to an issue: clicking the Continue
button in the SetupAccountApproved
step quickly transitions to the next step, SetupSiteAdded
, even while the form is still submitting. This results in the SetupSiteAdded
button being disabled with an active spinner for a few seconds, which is not ideal for user experience. To avoid this, maintaining the ProgressBar
during submission seems the most effective solution in SetupAccountApproved
.
However, we don't need to modify the older Adsense setup form components due to the changes in 4765, which will phase them out. Please have a look at this PR.
I've updated the IB accordingly and reduced the estimate. LMK WDYT. Thanks!
Thanks @hussain-t. That all being the case, this IB LGTM! :white_check_mark:
Verified:
ProgressBar
during form submissions or when navigating to the dashboard.ProgressBar
is replaced by a loading spinner within the button on the final setup screen of each module.Note: I could not test the last task in the QAB as setting up Tag Manager with GA4 does not work. Confirmed this with Tom. I will create a new bug ticket for this.
Feature Description
When setting up the AdSense, Analytics and Tag Manager modules, a flicker can occur when saving the settings.
As seen here, when pressing Continue on the AdSense setup screen, the loading state momentarily reverts to the previous view.
https://user-images.githubusercontent.com/18395600/218533953-b53023f3-fa16-4a19-8274-c1129048e3ce.mp4
Note that a similar thing can occur when pressing Configure Analytics on the Analytics setup screen, or Confirm & Continue on the Tag Manager setup screen, however when attempting to screen grab these, the video didn't capture the flicker frames.
See this comment below for details on how we should address this.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
SpinnerButton
component should be implemented to replace theProgressBar
component during form submission in all modules setup screens (forms).SpinnerButton
should visually indicate the loading state while the form is being submitted.SpinnerButton
should disable user interactions and prevent multiple submissions while the form is being processed.Implementation Brief
Analytics Setup Form
In
assets/js/modules/analytics/components/setup/SetupMain.js
:ProgressBar
component to remove theisDoingSubmitChanges
andisNavigating
checks.In
assets/js/modules/analytics/components/setup/SetupForm.js
:isDoingSubmitChanges
selector of thecore/analytics
store.isNavigating
selector of thecore/location
store.Button
component with theSpinnerButton
component.disabled
prop value to check for! canSubmitGA4Changes
ORisDoingSubmitChanges
ORisNavigating
.isSaving
prop to theSpinnerButton
component that checks forisDoingSubmitChanges
ORisNavigating
.AdSense Setup form
In
assets/js/modules/adsense/components/setup/v2/common/SetupAccountSiteUI.js
:Note: This component will be moved from
v2
directory once #4765 is merged.isDoingSubmitChanges
selector of thecore/adsense
store.isNavigating
selector of thecore/location
store.Button
component with theSpinnerButton
component (for the primary button).disabled
prop value to check forisDoingSubmitChanges
ORisNavigating
.isSaving
prop to theSpinnerButton
component that checks forisDoingSubmitChanges
ORisNavigating
.Tag Manager Setup Form
In
assets/js/modules/tagmanager/components/setup/SetupMain.js
:ProgressBar
component to removeisDoingSubmitChanges
,isNavigating
andsubmitInProgress
checks.In
assets/js/modules/tagmanager/components/setup/SetupForm.js
:isDoingSubmitChanges
selector of thecore/tagmanager
store.isNavigating
selector of thecore/location
store.submitInProgress
state from thetagmanagerSetup
store.Button
component with theSpinnerButton
component.disabled
prop value to check for! canSubmitChanges
ORisDoingSubmitChanges
ORisNavigating
ORsubmitInProgress
.isSaving
prop to theSpinnerButton
component that checks forisDoingSubmitChanges
ORisNavigating
ORsubmitInProgress
.Test Coverage
QA Brief
ProgressBar
during form submissions or when navigating to the dashboard.ProgressBar
is replaced by a loading spinner within the button (SpinnerButton
) on the final setup screen of each module.Continue to Analytics setup
.Changelog entry