Skip to content

Conversation

@staskus
Copy link
Contributor

@staskus staskus commented Jan 12, 2023

Fixes #19882

Description

Calculate Views & Visitors, Total Likes, and Total Comments card data on Insights tab in a similar way as on the web, by excluding today. Also, remove ambiguity by renaming This week and Last week to Last 7-days and Previous 7-days which explains the numbers more accurately.

⚠️ Additionally fixing the issue, where Followers card would not open details. A regression from #19830. Explaining in the commit and comment.

Testing instructions

Before all:

Enable "New Appearance for Stats" and "New Cards for Stats Insights" feature flag

Case 1:

  1. Navigate to Stats
  2. Verify the titles on the Views and Visitors card read as Last 7-days and Previous 7-days
  3. Verify that the graph for the Views and Visitors is displayed for the days excluding today
  4. Verify Information below the graph uses the same like 7-days
  5. Verify information on the Total Likes also reads like 7-days
  6. Verify information on the Total Comments also reads 7-days and not Week
  7. Also verify the Total count of Views, Visitors, Likes and Comments matches on the Web

Regression Notes

  1. Potential unintended areas of impact

Other cards start being represented in the wrong way when we switch to yesterday's date

  1. What I did to test those areas of impact (or what existing automated tests I relied on)

Code analysis. lastRequestedDate is only used for passing it to periodStore which is only used for those 3 cards.

  1. What automated tests I added (or what prevented me from doing so)

PR submission checklist:

  • I have completed the Regression Notes.
  • I have considered adding unit tests for my changes.
  • I have considered adding accessibility improvements for my changes.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

Images & Videos

image

image

image

image

- For routing to work, we need to include `.insightsFollowersWordPress` in allInsights
- For insight management to work, we need to remove `insightsFollowersWordPress` to avoid double `Followers` rows appearing. It happens because `insightsFollowersWordPress` and insightsFollowersEmail` share the same `InsightType` and are represented by a single card.
@staskus staskus added this to the 21.6 milestone Jan 12, 2023
@staskus
Copy link
Contributor Author

staskus commented Jan 12, 2023

@ravishanker, @irfano. Tagging you for reference, since there's identical ongoing ticket on Android.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Jan 12, 2023

You can test the changes in Jetpack from this Pull Request by:
  • Clicking here or scanning the QR code below to access App Center
  • Then installing the build number pr19900-c49a286 on your iPhone

If you need access to App Center, please ask a maintainer to add you.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Jan 12, 2023

You can test the changes in WordPress from this Pull Request by:
  • Clicking here or scanning the QR code below to access App Center
  • Then installing the build number pr19900-c49a286 on your iPhone

If you need access to App Center, please ask a maintainer to add you.

Copy link
Contributor

@guarani guarani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested by comparing the Views & Visitors card to the web and the data matches now since we're showing the same period (last 7 days excluding today).

Since we're close to shipping, I also smoke tested all the cards and everything seems to match the web. Nice work!

@staskus staskus merged commit 8c70bf1 into trunk Jan 17, 2023
@staskus staskus deleted the fix/19882-stats-make-consistent-with-the-web-by-excluding-today-from-week-insights branch January 17, 2023 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stats: Make Views & Visitors, Total Likes, and Total Comments cards data consistent with the Web

4 participants