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 no connection state #20842

Merged

Conversation

thomashorta
Copy link
Contributor

Fixes #20815

  • Implement NoConnection state for showing an error message when the Feed is opened without an internet connection
  • Initialize the UI State to Loading when there is an internet connection
  • Avoid refreshing the tags when there's no internet connection (pull-to-refresh and coming back from tag details)
  • Fix snackbar positioning
  • Extract Error Message UI logic for reuse in NoConnection and PostList.Error states

To Test:

  1. Open Jetpack
  2. Make sure reader_tags_feed FeatureConfig is ON (Debug Settings -> Remote Features
  3. Turn ON airplane mode
  4. Go to Reader
  5. Go to Your Tags feed
  6. Verify a connection error is shown
  7. Tap "Retry"
  8. Verify the screen starts loading and goes back to the connection error
  9. Turn OFF airplane mode and wait for internet connection to come back
  10. Tap "Retry"
  11. Verify the tags feed is loaded
  12. Pull to refresh
  13. Verify the tags feed is refreshed
  14. Turn ON airplane mode
  15. Pull to refresh
  16. Verify the feed is not refreshed and a Snackback with a connection error message is shown

Regression Notes

  1. Potential unintended areas of impact

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

    • Manual testing and unit testing
  3. What automated tests I added (or what prevented me from doing so)

    • Added tests covering no internet connection scenarios

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)

@dangermattic
Copy link
Collaborator

1 Warning
⚠️ strings.xml files should only be updated on release branches, when the translations are downloaded by our automation.

Generated by 🚫 Danger

Copy link

sonarcloud bot commented May 17, 2024

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

@wpmobilebot
Copy link
Contributor

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
Versionpr20842-18a2aa9
Commit18a2aa9
Direct Downloadwordpress-prototype-build-pr20842-18a2aa9.apk
Note: Google Login is not supported on these builds.

@wpmobilebot
Copy link
Contributor

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
Versionpr20842-18a2aa9
Commit18a2aa9
Direct Downloadjetpack-prototype-build-pr20842-18a2aa9.apk
Note: Google Login is not supported on these builds.

Copy link

codecov bot commented May 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 40.84%. Comparing base (b028ecd) to head (18a2aa9).
Report is 1 commits behind head on feature/tags-ia.

Additional details and impacted files
@@                 Coverage Diff                 @@
##           feature/tags-ia   #20842      +/-   ##
===================================================
+ Coverage            40.82%   40.84%   +0.01%     
===================================================
  Files                 1493     1493              
  Lines                68750    68766      +16     
  Branches             11346    11350       +4     
===================================================
+ Hits                 28070    28087      +17     
+ Misses               38132    38131       -1     
  Partials              2548     2548              

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

@daniloercoli
Copy link
Contributor

Hey Thomas! 👋
Code looks good (as always), and the testing steps are okay. However, I have a couple of questions:

  • I noticed that on the Discovery feed, the snackbar message is still the old version. Is it supposed to be the new one?
  • I also noticed that the Discovery screen doesn't show the "No Connection" screen when the feed is opened without an internet connection. It briefly shows it and then switches to the content. (See the attached picture).

photo1716200188

@thomashorta
Copy link
Contributor Author

hey @daniloercoli, thanks for the Review! This PR only touches the Your Tags feed. Unfortunately, the current code treats the connection state for each feed independently and it isn't straightforward to implement a solution that works across all feeds (especially the Discover feed, which uses a completely different Fragment).

So currently this only targets the Tags Feed.

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.

As discussed #20842 (comment), this PR only addresses the Tags Feed, so LGTM!

Base automatically changed from issue/20823-reader-tags-feed-retry to feature/tags-ia May 20, 2024 14:40
@thomashorta thomashorta merged commit 06d79f6 into feature/tags-ia May 20, 2024
21 of 24 checks passed
@thomashorta thomashorta deleted the issue/20815-reader-tags-feed-connection-error branch May 20, 2024 18:00
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.

4 participants