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] Update feed tags as Diff, keeping existing tag content #20860

Merged
merged 3 commits into from
May 22, 2024

Conversation

thomashorta
Copy link
Contributor

@thomashorta thomashorta commented May 21, 2024

Fixes #20811

When a new onTagsChanged is called and the current UI State is Loaded, let's just update the tags list and keep any content we already fetched before, by:

  • Removing rows from tags that are not in the new call
  • Adding rows for tags in the new call in the appropriate position, in the Initial state
  • Using modifier to animate content to the correct place, using tag slug as key

To Test:

  1. Open Jetpack
  2. Make sure reader_tags_feed Feature Config is ON
  3. Go to Reader
  4. Go to Your Tags feed
  5. Scroll horizontally in one of the tags and tap More from
  6. Unfollow the tag
  7. Go back
  8. Verify the tag is removed from the list but the existing tags don't reload

You can also test adding a new tag by:

  1. Go to Your Tags feed
  2. Scroll horizontally in one of the tags and tap More from
  3. Tap one of the posts
  4. Tap a tag from the post that you don't follow yet
  5. Follow that tag
  6. Hit back until you're back in the Your Tags feed
  7. Verify the new tag appears in the appropriate position and existing tags kept their state

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)

    • Added unit tests for new scenarios
    • Update unit tests for existing 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)

Thomas Horta added 3 commits May 21, 2024 13:14
Keep existing tags content untouched and only add new tags in initial state for
new tags, so the list updates in place.

Also add placement animation to the list items for a better UX.
Copy link

sonarcloud bot commented May 21, 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
Versionpr20860-13d03b1
Commit13d03b1
Direct Downloadwordpress-prototype-build-pr20860-13d03b1.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
Versionpr20860-13d03b1
Commit13d03b1
Direct Downloadjetpack-prototype-build-pr20860-13d03b1.apk
Note: Google Login is not supported on these builds.

Copy link

codecov bot commented May 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 40.91%. Comparing base (5bbddf0) to head (13d03b1).

Additional details and impacted files
@@                 Coverage Diff                 @@
##           feature/tags-ia   #20860      +/-   ##
===================================================
+ Coverage            40.88%   40.91%   +0.03%     
===================================================
  Files                 1493     1493              
  Lines                68770    68794      +24     
  Branches             11350    11352       +2     
===================================================
+ Hits                 28117    28149      +32     
+ Misses               38098    38091       -7     
+ Partials              2555     2554       -1     

☔ 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.

Nice work! LGTM.

@thomashorta thomashorta merged commit 5600b47 into feature/tags-ia May 22, 2024
21 of 26 checks passed
@thomashorta thomashorta deleted the issue/20811-update-only-tags-list branch May 22, 2024 19:01
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