WordPress-iOS
WordPress-iOS copied to clipboard
[Notifications] Add Like Post and Comment Inline Actions
Fixes #22466
Description
This PR adds the Post Like inline action.
Challenges
Row Fade Animation
When toggling the post liked status, the notification row reloads with a fade animation. The reason behind this is because the notifications screen is using the WPTableViewHandler
object, which observes Core Data changes. So when the notification object is updated locally, the WPTableViewHandler
catches this update and reloads the associated row. I couldn't figure out an easy way to disable this behavior.
I have tried setting tableViewHandler.updateRowAnimation = .none
but it didn't work.
Change Propagation
When a post's liked status is toggled anywhere on the app, this change isn't broadcasted to the Notifications screen. Here is how to reproduce this issue:
- Navigate to Notifications screen
- Tap on any new post notification
- Expect the Reader Detail screen to appear
- Like the post
- Go back to Notifications screen
- The post isn't liked
Ideally, when a post is liked on one screen, the same post should appear liked on all other loaded screens. I tested on Android and I was able to reproduce this issue.
Test Instructions
Posts
- Run the Jetpack app and switch to the notifications tab.
- Navigate to Notifications tab.
- Expect to see the "Star" icon on new post notifications.
- Tap the "Star" to like / un-like a new post notification.
- Expect the like status to immediately change
- Tap on the notification row.
- Expect the Reader Detail screen to appear
- Verify the post is liked
Comments
- Run the Jetpack app and switch to the notifications tab.
- Navigate to Notifications tab.
- Expect to see the "Star" icon on comment notifications.
- Tap the "Star" to like / un-like a comment.
- Expect the like status to immediately change
- Tap on the notification row.
- Depending on whether the user can moderate comments:
- User is admin: Expect the Comment Detail screen to appear.
- User is not admin: Expect the Reader Comments screen to appear.
- Verify the comment is liked.
Regression Notes
-
Potential unintended areas of impact Smoke test post like feature in other parts of the app ( e.g Reader )
-
What I did to test those areas of impact (or what existing automated tests I relied on) Manual testing
-
What automated tests I added (or what prevented me from doing so) N/A
PR submission checklist:
- [x] I have completed the Regression Notes.
- [x] I have considered adding unit tests for my changes.
- [x] I have considered adding accessibility improvements for my changes.
- [x] I have considered if this change warrants user-facing release notes and have added them to
RELEASE-NOTES.txt
if necessary.
📲 You can test the changes from this Pull Request in WordPress Alpha by scanning the QR code below to install the corresponding build.
App Name | ![]() |
|
Configuration | Release-Alpha | |
Build Number | pr22688-55200cd | |
Version | 24.3 | |
Bundle ID | org.wordpress.alpha | |
Commit | 55200cd4a79113ed1ec3b167d950dfa36666187e | |
App Center Build | WPiOS - One-Offs #8981 |
📲 You can test the changes from this Pull Request in Jetpack Alpha by scanning the QR code below to install the corresponding build.
App Name | ![]() |
|
Configuration | Release-Alpha | |
Build Number | pr22688-55200cd | |
Version | 24.3 | |
Bundle ID | com.jetpack.alpha | |
Commit | 55200cd4a79113ed1ec3b167d950dfa36666187e | |
App Center Build | jetpack-installable-builds #8011 |
Liking a post crashes for me, I'm considering changing the approach so I will mark the PR as draft for now. cc @alpavanoglu
1 Warning | |
---|---|
:warning: | This PR is larger than 500 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews. |
Generated by :no_entry_sign: Danger
🐛 When the like status is changed from the details screen bottom bar, it doesn't reflect on the row after going back. This is still the case after a pull-to-refresh action.