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

[Tags Feed] Lazy load tag rows #20790

Merged
merged 5 commits into from
May 10, 2024

Conversation

thomashorta
Copy link
Contributor

Fixes #20708

Add lazy loading to tag rows so the tag posts are only fetched when the tag component is rendered. This avoids loading content that might never be seen by the user.

Also move the execution of fetching the posts for tags to the IO dispatcher.


To Test:

  1. Open Jetpack
  2. Make sure the reader_tags_feed feature config is on
  3. Go to the Reader
  4. Go to the Tags feed
  5. Verify the posts for the displayed tags are loaded
  6. Scroll down
  7. Verify the posts for tags that were offscreen show up in the loading state, then are loaded

Regression Notes

  1. Potential unintended areas of impact

    • N/A
  2. What I did to test those areas of impact (or what existing automated tests I relied on)

    • N/A
  3. What automated tests I added (or what prevented me from doing so)

    • Updated unit tests that rely on loading posts for tags

PR Submission Checklist:

  • I have completed the Regression Notes.
  • 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 (strike-out the not-applying and unnecessary ones):

  • WordPress.com sites and self-hosted Jetpack sites.
  • Portrait and landscape orientations.
  • Light and dark modes.
  • Fonts: Larger, smaller and bold text.
  • High contrast.
  • Talkback.
  • 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)
  • Large and small screen sizes. (Tablet and smaller phones)
  • Multi-tasking: Split screen and Pop-up view. (Android 10 or higher)

…ss-Android into issue/20708-tags-feed-lazy-load
@wpmobilebot
Copy link
Contributor

wpmobilebot commented May 9, 2024

WordPress📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress WordPress
FlavorJalapeno
Build TypeDebug
Versionpr20790-4acb2b9
Commit4acb2b9
Direct Downloadwordpress-prototype-build-pr20790-4acb2b9.apk
Note: Google Login is not supported on these builds.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented May 9, 2024

Jetpack📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack Jetpack
FlavorJalapeno
Build TypeDebug
Versionpr20790-4acb2b9
Commit4acb2b9
Direct Downloadjetpack-prototype-build-pr20790-4acb2b9.apk
Note: Google Login is not supported on these builds.

Copy link

codecov bot commented May 9, 2024

Codecov Report

Attention: Patch coverage is 74.54545% with 14 lines in your changes are missing coverage. Please review.

Project coverage is 40.78%. Comparing base (2a41ebc) to head (8067c7b).
Report is 1 commits behind head on feature/tags-ia.

❗ Current head 8067c7b differs from pull request most recent head 4acb2b9. Consider uploading reports for the commit 4acb2b9 to get more accurate results

Files Patch % Lines
...viewmodels/tagsfeed/ReaderTagsFeedUiStateMapper.kt 40.00% 6 Missing ⚠️
...der/viewmodels/tagsfeed/ReaderTagsFeedViewModel.kt 85.71% 4 Missing and 2 partials ⚠️
...droid/ui/reader/repository/ReaderPostRepository.kt 33.33% 2 Missing ⚠️
Additional details and impacted files
@@               Coverage Diff                @@
##           feature/tags-ia   #20790   +/-   ##
================================================
  Coverage            40.78%   40.78%           
================================================
  Files                 1493     1493           
  Lines                68611    68625   +14     
  Branches             11332    11333    +1     
================================================
+ Hits                 27984    27991    +7     
- Misses               38086    38093    +7     
  Partials              2541     2541           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@daniloercoli daniloercoli left a comment

Choose a reason for hiding this comment

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

Left a minor comment, but other than that, it looks good to merge!

Copy link

sonarcloud bot commented May 10, 2024

Quality Gate Passed Quality Gate passed

Issues
1 New issue
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@thomashorta thomashorta merged commit 2aa1835 into feature/tags-ia May 10, 2024
20 checks passed
@thomashorta thomashorta deleted the issue/20708-tags-feed-lazy-load branch May 10, 2024 18:56
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

3 participants