Skip to content
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

Stats Insights: Optimize table view updates by integrating diffable data source #22592

Merged
merged 19 commits into from Apr 8, 2024

Conversation

staskus
Copy link
Contributor

@staskus staskus commented Feb 12, 2024

Use a diffable data source within Stats Insights and Stats Insights Details to make table view cell reloads more efficient. More information about implementation in: #22542

Related diff: wordpress-mobile/WordPressKit-iOS#751

To test:

  1. Open Stats Insights
  2. Confirm data loads correctly without flickering
  3. Tap on Insights management button on top right
  4. Remove all cards
  5. Confirm empty view with a button is shown
  6. Add all cards
  7. Tap "View More" on all the cards
  8. Confirm Stats Insights Details view opens

Regression Notes

  1. Potential unintended areas of impact

Breaking loading of data within existing Stats Insights and Stats Insights Details.

  1. What I did to test those areas of impact (or what existing automated tests I relied on)
  • Manual testing
  • SiteStatsInsightsViewModelTests should still succeed
  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.

Testing checklist:

  • WordPress.com sites and self-hosted Jetpack sites.
  • Portrait and landscape orientations.
  • Light and dark modes.
  • Fonts: Larger, smaller and bold text.
  • High contrast.
  • VoiceOver.
  • Languages with large words or with letters/accents not frequently used in English.
  • Right-to-left languages. (Even if translation isn’t complete, formatting should still respect the right-to-left layout)
  • iPhone and iPad.
  • Multi-tasking: Split view and Slide over. (iPad)

@staskus staskus changed the title Task/stats insights diffable optimization Stats Insights: Optimize table view updates by integrating diffable data source Feb 12, 2024
@dangermattic
Copy link
Collaborator

dangermattic commented Feb 12, 2024

1 Warning
⚠️ This PR is larger than 500 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Feb 12, 2024

Jetpack Alpha📲 You can test the changes from this Pull Request in Jetpack Alpha by scanning the QR code below to install the corresponding build.
App NameJetpack Alpha Jetpack Alpha
ConfigurationRelease-Alpha
Build Numberpr22592-3c87ba7
Version24.6
Bundle IDcom.jetpack.alpha
Commit3c87ba7
App Center Buildjetpack-installable-builds #8456
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Feb 12, 2024

WordPress Alpha📲 You can test the changes from this Pull Request in WordPress Alpha by scanning the QR code below to install the corresponding build.
App NameWordPress Alpha WordPress Alpha
ConfigurationRelease-Alpha
Build Numberpr22592-3c87ba7
Version24.6
Bundle IDorg.wordpress.alpha
Commit3c87ba7
App Center BuildWPiOS - One-Offs #9413
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

@staskus staskus changed the base branch from trunk to task/stats-traffic-diffable-optimization February 13, 2024 09:10
@staskus staskus force-pushed the task/stats-insights-diffable-optimization branch from 4ec49cd to ce0d1fe Compare February 13, 2024 09:10
@peril-wordpress-mobile
Copy link

Warnings
⚠️ PR has more than 500 lines of code changing. Consider splitting into smaller PRs if possible.

Generated by 🚫 dangerJS

Base automatically changed from task/stats-traffic-diffable-optimization to trunk February 22, 2024 09:41
@staskus staskus marked this pull request as ready for review February 22, 2024 15:53
@staskus staskus force-pushed the task/stats-insights-diffable-optimization branch from 02c194f to d9c51c2 Compare February 22, 2024 15:54
@staskus staskus requested a review from guarani February 22, 2024 15:55
@staskus staskus added this to the 24.4 milestone Feb 22, 2024
@staskus
Copy link
Contributor Author

staskus commented Feb 22, 2024

@guarani review for this can wait after we're done with Traffic tab.

@staskus staskus modified the milestones: Pending, 24.5 Mar 13, 2024
@staskus
Copy link
Contributor Author

staskus commented Mar 13, 2024

I added Stats Insights Details support in this PR.
Stats Period Details is implemented in #22823.

These two PRs should cover diffable data source support for all the Stats.

@guarani
Copy link
Contributor

guarani commented Mar 13, 2024

Related to the failing CI checks: https://a8c.slack.com/archives/C05N140C8H5/p1710357494940709

@guarani
Copy link
Contributor

guarani commented Mar 15, 2024

I moved this to a new GitHub project, more context here: p1710464002701159-slack-C06BR07TJHK

@staskus staskus modified the milestones: 24.5, Pending Mar 15, 2024
@staskus
Copy link
Contributor Author

staskus commented Mar 19, 2024

TODO: Requires the same fix #22857

Done:

…y methods

Usage of performBatchUpdates is not allowed if table view depends on a diffable data source and can result in crashes
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 this and can see the improvement!
The changes themselves were hard to review due to the number of lines updated, so I skimmed the changes and relied on testing.

@staskus staskus modified the milestones: Pending, 24.7 Apr 8, 2024
@staskus staskus enabled auto-merge April 8, 2024 10:07
@staskus staskus merged commit 901c7b3 into trunk Apr 8, 2024
24 of 26 checks passed
@staskus staskus deleted the task/stats-insights-diffable-optimization branch April 8, 2024 10:25
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.

None yet

4 participants