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] Implement pull-to-refresh #20791

Merged
merged 5 commits into from
May 10, 2024

Conversation

thomashorta
Copy link
Contributor

Fixes #20707

Add pull-to-refresh to Tags Feed, which reloads the user's sites and tags then "restarts" the Tags Feed, fetching newer posts for each of the tags.

This also fixes the wrong post image being shown (it was showing the site avatar instead of the featured image).


To Test:

  1. Open Jetpack
  2. Turn on reader_tags_feed feature config
  3. Go to Reader
  4. Go to Tags feed
  5. Scroll a bit, waiting for the posts to load
  6. Wait a few minutes (optional: go to another device/web and follow a new tag)
  7. Pull to refresh in the Tags feed
  8. Verify the tags are refreshed
  9. Verify the posts are loaded for all tags

Note: also verify that the post images are now correct.


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 existing tests
    • Added unit tests for the refresh behavior

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)

@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
Versionpr20791-03d53da
Commit03d53da
Direct Downloadjetpack-prototype-build-pr20791-03d53da.apk
Note: Google Login is not supported on these builds.

@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
Versionpr20791-03d53da
Commit03d53da
Direct Downloadwordpress-prototype-build-pr20791-03d53da.apk
Note: Google Login is not supported on these builds.

Copy link
Contributor

@develric develric left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @thomashorta 🙇 ! Code is clean and looks good (good job 👍 ).

I tested the PR as per steps and it works correctly. Also checked the posts featured images are now loaded as expected (good catch 👍 ).

I'm approving and we can merge this PR 🎉 .


Side note: while testing I noticed something that is not related to this PR (if it's not on the radar already I can create a separate GH issue for later, just let me know 👍 ).

The position in the feed resets to the top of the feed on screen rotation (it seems consistent). This might be annoying when you have many tags you follow and you are deep down the feed and sent to the top. We have more urgent tasks to cover, but as said I'm happy to create a GH issue if needed so we do not forget to improve this along the way 🙇 .

@thomashorta thomashorta force-pushed the issue/20707-tags-feed-ptr branch from 313b4a1 to 03d53da Compare May 10, 2024 15:40
Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

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

See analysis details on SonarCloud

Copy link

codecov bot commented May 10, 2024

Codecov Report

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

Project coverage is 40.79%. Comparing base (4acb2b9) to head (03d53da).

Files Patch % Lines
...der/viewmodels/tagsfeed/ReaderTagsFeedViewModel.kt 71.42% 0 Missing and 6 partials ⚠️
Additional details and impacted files
@@                       Coverage Diff                        @@
##           issue/20708-tags-feed-lazy-load   #20791   +/-   ##
================================================================
  Coverage                            40.78%   40.79%           
================================================================
  Files                                 1493     1493           
  Lines                                68627    68642   +15     
  Branches                             11335    11337    +2     
================================================================
+ Hits                                 27991    28003   +12     
- Misses                               38093    38095    +2     
- Partials                              2543     2544    +1     

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

Base automatically changed from issue/20708-tags-feed-lazy-load to feature/tags-ia May 10, 2024 18:56
@thomashorta thomashorta merged commit 78f1e2f into feature/tags-ia May 10, 2024
21 checks passed
@thomashorta thomashorta deleted the issue/20707-tags-feed-ptr branch May 10, 2024 18:57
@develric
Copy link
Contributor

develric commented May 16, 2024

Just leaving a note that I created a GH issue here for the screen rotation issue identified in this comment as per our slack alignment.

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.

3 participants