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

🤖 Use multiple avatars for multiple new likes or subscribers #20133

Merged

Conversation

antonis
Copy link
Contributor

@antonis antonis commented Feb 6, 2024

Fixes #20039

Description

This PR adds multiple avatars for multiple post or comment likes and multiple subscribers

Light mode Dark mode
Screenshot_20240207_164315 Screenshot_20240207_164327
Landcape RTL
Screenshot_20240207_164346 Screenshot_20240207_164414

To Test:

  1. Open the notification tab in the Jetpack app
  2. Verify that 2 avatars appear for 2 likes/subscribes
  3. Verify that 3 avatars appears for more than 2 likes/subscribes

Regression Notes

  1. Potential unintended areas of impact

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

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

    • We plan to add tests after refactoring this part of the code

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:

  • 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 Feb 6, 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
Versionpr20133-7d29468
Commit7d29468
Direct Downloadjetpack-prototype-build-pr20133-7d29468.apk
Note: Google Login is not supported on these builds.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Feb 6, 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
Versionpr20133-7d29468
Commit7d29468
Direct Downloadwordpress-prototype-build-pr20133-7d29468.apk
Note: Google Login is not supported on these builds.

@antonis antonis force-pushed the issue/20039-notif-multiple-avatars branch from 9d9252b to 504e7d3 Compare February 6, 2024 18:15
Copy link

codecov bot commented Feb 6, 2024

Codecov Report

Attention: 11 lines in your changes are missing coverage. Please review.

Comparison is base (fa83b6f) 40.21% compared to head (7d29468) 40.20%.
Report is 7 commits behind head on feature/notifications_refresh_p1.

Files Patch % Lines
...c/main/java/org/wordpress/android/models/Note.java 0.00% 11 Missing ⚠️
Additional details and impacted files
@@                         Coverage Diff                          @@
##           feature/notifications_refresh_p1   #20133      +/-   ##
====================================================================
- Coverage                             40.21%   40.20%   -0.01%     
====================================================================
  Files                                  1468     1468              
  Lines                                 67536    67547      +11     
  Branches                              11181    11184       +3     
====================================================================
  Hits                                  27157    27157              
- Misses                                37890    37901      +11     
  Partials                               2489     2489              

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

@antonis antonis requested review from mkevins and jarvislin February 7, 2024 08:10
@antonis antonis marked this pull request as ready for review February 7, 2024 08:10
@dangermattic
Copy link
Collaborator

1 Warning
⚠️ PR is not assigned to a milestone.

Generated by 🚫 Danger

@peril-wordpress-mobile
Copy link

Warnings
⚠️ PR is not assigned to a milestone.

Generated by 🚫 dangerJS

@antonis antonis linked an issue Feb 7, 2024 that may be closed by this pull request
@antonis
Copy link
Contributor Author

antonis commented Feb 7, 2024

I've tweaked the dual avatar sizes and updated the alignment (ref p1707316051751449/1707227233.708549-slack-C06BWNSR02K) with 7d29468

Copy link
Contributor

@mkevins mkevins left a comment

Choose a reason for hiding this comment

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

The code is sensible, given the current constraints. I tested this on a Pixel 3a (physical device) and it is working as described.

Nice work Antonis!

Comment on lines +222 to +235
synchronized (mSyncLock) {
JSONArray bodyArray = mNoteJSON.optJSONArray("body");
if (bodyArray != null && bodyArray.length() > 0) {
ArrayList<String> iconUrls = new ArrayList<>();
for (int i = 0; i < bodyArray.length(); i++) {
String iconUrl = JSONUtils.queryJSON(bodyArray, "body[" + i + "].media[0].url", "");
if (iconUrl != null && !iconUrl.isEmpty()) {
iconUrls.add(iconUrl);
}
}
return iconUrls;
}
}
return null;
Copy link
Contributor

Choose a reason for hiding this comment

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

This ad-hoc parsing seems reasonable for now, given that this whole file is due for refactoring to Room / FluxC (i.e. it likely isn't worth refactoring in piecemeal).

@mkevins mkevins merged commit cf22b77 into feature/notifications_refresh_p1 Feb 8, 2024
21 checks passed
@mkevins mkevins deleted the issue/20039-notif-multiple-avatars branch February 8, 2024 06:10
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.

🤖 Use multiple avatars for multiple new likes or subscribers
4 participants