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

🤖 Bring the user straight to the comments reader view #20186

Merged

Conversation

antonis
Copy link
Contributor

@antonis antonis commented Feb 14, 2024

Fixes #20096


Description

This PR navigates non-admin users that cannot moderate a comment directly to the comments reader view

To Test:

A. Non-admin user

  1. Create a post with an authorised user and add some comments
  2. Log in with another user in the Jetpack app that does not administer the blog from (1)
  3. Search and follow the blog from (1)
  4. Find the post from (1) and follow the conversation in the reader enabling notifications
  5. Write another comment as the authorised user on the post from (1) (e.g. on the web)
  6. Verify that you receive a notification for that comment
  7. Tap on the comment notification from 3 in the notifications list
  8. Expect the Reader Comments screen to appear scrolled (if needed) to the comment from 3.

B. Admin user ( Regression )

  1. Log in with an admin user
  2. Open the notifications in the app
  3. Navigate to Notifications.
  4. Tap on the comment notification from A5 in the notifications list
  5. Expect the Comment Detail screen to appear were the user can moderate the comment

C. Push notifications

Repeat (A) and (B) above by tapping on the system push notification


Regression Notes

  1. Potential unintended areas of impact

    • Notifications detail view
  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)

    • Added NotificationsListViewModelTest with the logic for opening the comment in the reader

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 14, 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
Versionpr20186-ea7ee3b
Commitea7ee3b
Direct Downloadwordpress-prototype-build-pr20186-ea7ee3b.apk
Note: Google Login is not supported on these builds.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Feb 14, 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
Versionpr20186-ea7ee3b
Commitea7ee3b
Direct Downloadjetpack-prototype-build-pr20186-ea7ee3b.apk
Note: Google Login is not supported on these builds.

Copy link

codecov bot commented Feb 14, 2024

Codecov Report

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

Comparison is base (fdd373b) 40.11% compared to head (ea7ee3b) 40.14%.

Files Patch % Lines
.../ui/notifications/NotificationsListFragmentPage.kt 0.00% 13 Missing ⚠️
...oid/ui/notifications/NotificationsListViewModel.kt 93.33% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@                         Coverage Diff                          @@
##           feature/notifications_refresh_p1   #20186      +/-   ##
====================================================================
+ Coverage                             40.11%   40.14%   +0.02%     
====================================================================
  Files                                  1469     1469              
  Lines                                 67755    67782      +27     
  Branches                              11226    11230       +4     
====================================================================
+ Hits                                  27179    27209      +30     
+ Misses                                38082    38078       -4     
- Partials                               2494     2495       +1     

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

@antonis antonis changed the base branch from trunk to feature/notifications_refresh_p1 February 14, 2024 21:52
@antonis antonis marked this pull request as ready for review February 15, 2024 10:35
@antonis antonis requested review from mkevins and jarvislin February 15, 2024 10:36
@antonis antonis mentioned this pull request Feb 15, 2024
13 tasks
Antonis Lilis added 3 commits February 15, 2024 14:15
…CommentInTheReader

# Conflicts:
#	WordPress/src/main/java/org/wordpress/android/ui/notifications/NotificationsListFragmentPage.kt
#	WordPress/src/main/java/org/wordpress/android/ui/notifications/NotificationsListViewModel.kt
Copy link
Contributor

@jarvislin jarvislin 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 making the change! Code looks good.

A. Non-admin user
I found the behavior is different when I clicked on the system notification and the item in the notification tab.

From system notification From notification tab
截圖 2024-02-16 中午12 43 42 截圖 2024-02-16 中午12 43 50

B. Admin user
The behaviors are the same as expected.

From system notification From notification tab
Screenshot_20240216-125231 Screenshot_20240216-125231

@mkevins
Copy link
Contributor

mkevins commented Feb 16, 2024

I've tested this on a Pixel 3a (physical device) and it is working as described. I left one minor question in the code, but feel free to consider it non-blocking.

One minor issue I noticed, though I don't think it is related with this PR is that when tapping the notification in steps for test (A), from the system UI, the app got stuck in a loading state:

The reason I think this is possibly unrelated is that I also happened later by simply opening the app from the home screen. I'm mentioning it, in case there is something about the steps followed here that causes this.

@antonis
Copy link
Contributor Author

antonis commented Feb 16, 2024

Thank you both for testing 🙇

I found the behavior is different when I clicked on the system notification and the item in the notification tab.

Good catch @jarvislin 👍
I didn't cover this flow with my PR. I'll check this now.

The reason I think this is possibly unrelated is that I also happened later by simply opening the app from the home screen. I'm mentioning it, in case there is something about the steps followed here that causes this.

Thank you for reporting @mkevins 🙇
I'll have a look in case this can be covered in this PR.

NotificationsListFragment
.openNoteForReply(this, noteId, shouldShowKeyboard, null,
NotesAdapter.FILTERS.FILTER_ALL, true);
if (mNotificationsViewModel == null) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've added the initialisation here since the initViewModel() has not been called in this flow

@antonis
Copy link
Contributor Author

antonis commented Feb 16, 2024

Thanks again for catching this @jarvislin 🙇

I found the behavior is different when I clicked on the system notification and the item in the notification tab.

I've cover this case with d089b05
I don't like the way this is structured much and I'll examine a possible refactoring in a follow up PR.

@antonis antonis requested review from jarvislin and mkevins February 16, 2024 08:14
@antonis
Copy link
Contributor Author

antonis commented Feb 16, 2024

The reason I think this is possibly unrelated is that I also happened later by simply opening the app from the home screen. I'm mentioning it, in case there is something about the steps followed here that causes this.

@mkevins I've run into the loading state (with flow B) but wasn't able to reproduce the stuck state. I also tried disabling the network after receiving the notification but in this case the notifications disappear on my device and I'm not able to continue the flow.

Screen_recording_20240216_101936.mp4

I've tested this on a Pixel 3a (physical device)

What Android version are you running? Any special setup in your network?

Antonis Lilis added 2 commits February 16, 2024 11:03
…CommentInTheReader

# Conflicts:
#	WordPress/src/main/java/org/wordpress/android/ui/notifications/NotificationsListViewModel.kt
Copy link
Contributor

@jarvislin jarvislin left a comment

Choose a reason for hiding this comment

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

I've cover this case with d089b05
I don't like the way this is structured much and I'll examine a possible refactoring in a follow up PR.

The test result is as expected, LGTM!

@antonis antonis merged commit e302eb7 into feature/notifications_refresh_p1 Feb 16, 2024
19 checks passed
@antonis antonis deleted the issue/20096-openCommentInTheReader branch February 16, 2024 11:30
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.

🤖 Bring the user straight to the comments reader view
4 participants