google / site-kit-wp

Site Kit is a one-stop solution for WordPress users to use everything Google has to offer to make them successful on the web.
https://sitekit.withgoogle.com
Apache License 2.0
1.23k stars 286 forks source link

Improve zero data message for "Top recent trending pages" key metric tile #8315

Closed nfmohit closed 2 months ago

nfmohit commented 7 months ago

Feature Description

The "Top recent trending pages" key metric tile displays report data for traffic that is targeted to posts that were published in the past 3 days. For sites that have traffic, but there aren't any posts created in the past 3 days, or they haven't got much traffic yet, the zero data state message is misleading. See:

image

In cases where the site has traffic in general but there isn't any data to show in the "Top recent trending pages", the zero data state message should be improved to reflect the correct scenario.


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

Acceptance criteria

Implementation Brief

Test Coverage

QA Brief

Changelog entry

nfmohit commented 7 months ago

Hi @marrrmarr.

In the ACs, I have added a placeholder updated text for this state, and have assigned it to you if you would like to help with an improved version.

Thank you!

nfmohit commented 7 months ago

Update: Mariya kindly updated the copy, moving this to ACR.

eugene-manuilov commented 7 months ago

AC ✔️

benbowler commented 7 months ago

Added an IB, I considered adding a prop and extending the ZeroDataMessage message, however this component is super simple, returning text only based on a few conditions. It was simpler to replace it's use in this component only, if in future we need to customise more of these messages we can consider updating the ZeroDataMessage adding a customMessage prop.

eugene-manuilov commented 7 months ago

@benbowler, the idea for this task is not to replace the existing zero data state message, but to add a new one that will be shown if Analytics has data in general but there is not enough data to display in that widget in particular. For the standard case, when Analytics has no data at all, we should continue showing the standard zero data message.

benbowler commented 6 months ago

Hey @eugene-manuilov, updated to fully address the AC.

eugene-manuilov commented 6 months ago

Thanks, @benbowler. IB ✔️

mohitwp commented 2 months ago

QA Update ✅

"No data to display: either no pages were published in the last three days, or they haven't received any visitors yet"

**zero data state** ![image](https://github.com/user-attachments/assets/cdb3f890-8b33-4bf0-8232-6373fd796e1d) **gathering state** : ![image](https://github.com/user-attachments/assets/30ad0241-9fbd-4b5d-a531-84412c28bcc6)
aaemnnosttv commented 2 months ago

The change looks good but it also looks like this message requires the height of the widgets to become taller than they would be otherwise. If so, then this would create a layout shift in response to the report that comes back which would not be good. Would you please check @mohitwp ? I don't think this need to block the issue but could inform a follow-up.

mohitwp commented 2 months ago

QA Update ✅

@aaemnnosttv

I verified padding of tiles on both latest and main environment. On both environment tiles padding and sizes are same. So, heights of tiles are same on both latest and main. cc @wpdarren

**Latest :** ![image](https://github.com/user-attachments/assets/1da9debf-491c-49b1-b86b-6268b4d7a22e) ![image](https://github.com/user-attachments/assets/f65c3dca-a72f-44de-a744-66483e39c50b) **Main :** ![image](https://github.com/user-attachments/assets/64b462cf-9bd3-40c3-958b-c785d69427e0) ![image](https://github.com/user-attachments/assets/a7de22d0-f492-4d94-8748-e4ae6899bfd7)
aaemnnosttv commented 2 months ago

Great, thanks @mohitwp !