site-kit-wp
site-kit-wp copied to clipboard
Minor UX bug on AdSense Settings When Publisher ID loading
Bug Description
Minor UX bug when you go to AdSense settings. If you click on the Check your site status
link while the Publisher ID is loading (this can take a couple of seconds), the settings page reloads rather than to AdSense sites page. It's only when the Publisher ID has loaded that the link works as expected.
Not a huge issue, but wondering if it's possible to improve the UX here?
Steps to reproduce
- Go to 'Site Kit Settings'
- Click on 'AdSense'
- Click the 'Check your site status' straightaway and before Publisher ID loads.
- See error
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
- The link to
Check your site status
should be unclickable until the URL for it is available (initially it isundefined
but this isn't accounted for)
Implementation Brief
- In
assets/js/modules/adsense/components/settings/SettingsView.js
:- If
siteStatusURL
is undefined, add the 'disabled' prop to the<Link>
component so it is not clickable until it is loaded.
- If
Test Coverage
- No changes expected
QA Brief
Changelog entry
@aaemnnosttv The AC suggests rendering the <Link>
but making it "Visually Hidden". Does this mean wrapping the entire component within the <VisuallyHidden>
component? I feel this bug can be resolved easily if we just disable the link until the URL loads which is what I have suggested in the IB for now. In my testing, the loading is super quick on most sites. Or should we just show a loading bar for the whole component like we do for other settings views? This will avoid any colour changes or link appearing flickers?
IB ✔️
The AC suggests rendering the
<Link>
but making it "Visually Hidden". Does this mean wrapping the entire component within the<VisuallyHidden>
component? I feel this bug can be resolved easily if we just disable the link until the URL loads which is what I have suggested in the IB for now. In my testing, the loading is super quick on most sites. Or should we just show a loading bar for the whole component like we do for other settings views? This will avoid any colour changes or link appearing flickers?
@jimmymadon VisuallyHidden
is for screen readers so that wouldn't work as was intended here. The idea was to use visibility: hidden
to hide the link until it is ready but also to not create a shift in the process by not rendering it at all. Using disabled
should work well here. I forgot that our Link
component has that. Using disabled
and removing that later is more consistent with other usage we have so +1 for that. I'll update the AC.
Edit: please also remember to populate the test coverage section, even when there are no changes to make there 🙂
QA Update: ✅
Verified:
- The link is 'disabled'/'unclickable' when viewing AdSense settings while the Publisher ID is loading.
- Ran through a smoke test various links within the plugin - especially links with the "external" image/icon.
https://user-images.githubusercontent.com/73545194/189014803-bbd66921-195f-4e25-af90-bf79080abbab.mp4