-
Notifications
You must be signed in to change notification settings - Fork 286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement the loading state for the Audience Tile #8145
Comments
I've moved this back to Backlog as the final in-progress changes to the design doc, relating to audience caching, will probably affect the AC for this one |
The audience caching aspect of the design doc has been sufficiently finalised, and I've moved this back to AC. |
Hey @kuasha420, thanks for drafting this IB.
Hmm, if I understand correctly this will result in nothing being displayed for the tiles while However this layout shift is something we want to avoid - we should instead be showing the tiles for the currently configured selection in their loading state while the sync is happening, in the assumption that the most likely path is for the audiences to still exist so we can show the tiles without a layout shift occurring. Of course if one of the edge cases occurs then we'll show the appropriate component and there may be a shift at that point, but we want to optimise for the UX for the most likely happy path view. |
Thank you for the review and raising this great point about layout shift. We definitely want to optimize the layout shift for the happy path. I've updated the IB accordingly. Please, let me know what you think. Cheers. |
Thanks @kuasha420, that's looking good. A couple of last points:
|
Thanks @techanvil. The Edits are perfect. Thank you. I've also updated the use of |
Thanks @kuasha420! I do think it's worthwhile in order to avoid making any requests while the widget is not in-view, which is our preferred pattern. That update LGTM. IB ✅ |
QA Update ✅
Loading state- Recording.1233.mp4Audience Removal- Recording.1234.mp4 |
Feature Description
Implement the loading state for the Audience Tile.
See audience tiles > loading state in the design doc.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Implementation Brief
assets/js/modules/analytics-4/datastore/audiences.js
:maybeSyncAvailableAudiences
:availableAudiencesLastSyncedAt
Analytics Module settings value usinggetAvailableAudiencesLastSyncedAt
selector.availableAudiencesLastSyncedAt
timestamp and run thesyncAvailableAudiences
if so.availableAudiences
andconfiguredAudiences
using their respectiveget**
selectors.configuredAudiences
that are no longer available inavailableAudiences
.assets/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTiles/index.js
:widgetLoading
that is a boolean.loading
constant to also be true when thewidgetLoading
is true.assets/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTile/index.js
:TODO: Loading states will be implemented as part of https://github.com/google/site-kit-wp/issues/8145.
comment.assets/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/index.js
:availableAudiencesSynced
usinguseState
hook which is initiallyfalse
.syncAvailableAudiences
action from Analytics module usinguseDispatch
hook.useInView
hook) and theavailableAudiencesSynced
isfalse
:maybeSyncAvailableAudiences
action.availableAudiencesSynced
totrue
afterwards.maybeSyncAvailableAudiences
isfalse
or eitheravailableAudiences
orconfiguredAudiences
is not loaded (ie.undefined
) return theAudienceTiles
element with thewidgetLoading
prop beingtrue
.hasMatchingAudience
isfalse
, returnWidgetNull
.AudienceTiles
with the thewidgetLoading
prop beingfalse
.Test Coverage
AudienceTilesWidget
component.QA Brief
Confirm the
AudienceTile
->Loading
story matches the figma designs (Note: the preview block heights have been adapted from the Figma design to better match the components they are simulating so they should be assessed on that basis.)Enable the Audience Segmentation feature flag.
When the Audience Segmentation tiles load you should initially see the new loading state on any tiles when first resolving.
Configure some Audiences in your Audience Segmentation widget, then delete one/several of these audiences in Google Analytics.
Set the
availableAudiencesLastSyncedAt
in thewp_options
->googlesitekit_analytics-4_settings
to0
.Reload the Audience Segmentation section and these deleted audiences should be removed from your configured audiences.
Changelog entry
The text was updated successfully, but these errors were encountered: