-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Adding unread posts count to Reader bottom sheet #13625
Conversation
…also on unseen count.
You can trigger optional UI/connected tests for these changes by visiting CircleCI here. |
You can test the changes on this Pull Request by downloading the APK here. |
# Conflicts: # WordPress/src/main/java/org/wordpress/android/datasets/ReaderBlogTable.java # WordPress/src/main/java/org/wordpress/android/datasets/ReaderDatabase.java # WordPress/src/main/java/org/wordpress/android/models/ReaderBlog.java
…ue/13454-reader-unread-posts-count # Conflicts: # WordPress/src/main/res/layout/subfilter_list_item.xml
This looks good to me, thanks @develric! |
Hey @develric, sorry for the delay on this one. I'll make sure to take a look at it by tomorrow, if no one gets to it before me :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes @develric! I've tested the app and everything seems to be working as expected. Code also looks pretty good – I just left one comment below, but it's pretty minor.
@@ -81,6 +82,10 @@ public static ReaderBlog fromJson(JSONObject json) { | |||
blog.numSubscribers = json.optInt("subscribers_count"); | |||
} | |||
|
|||
if (json.has("unseen_count")) { | |||
blog.numUnseenPosts = json.optInt("unseen_count"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checking that the parameter exists with has()
doesn't seem to be necessary here, as we're using optInt()
which fallbacks to 0
by default.
Hey @renanferrari 👋 , thanks so much for the review 🙇 ! I agree with the np, since you already approved this one and I need to create a dedicated PR to change the multiplier from lower case k to upper case K I'm going to merge this one and will manage it in the new PR. Thanks again 😄 |
Fixes #13454
This adds unread posts count to the reader filter bottom sheet. Note that to align the reader subfilter to the iOS implementation we removed the selected item checkmark in this #13648
The information about the unread posts is contained in the endpoint
read/following/mine
from v1.2 API, so we needed to upgrade the rest client from v1.1 for this call.The following images show the implemented result both in light and dark mode.
Note 1: please note that the update of the counters is async so sometimes is possible you need to Pull To Refresh before to get the updated numbers in the bottom sheet
Note 2: to see the counters in Calypso, it is possible you need to use a a8c account
Note 3: currently when a post is read from the app is not marked as seen so the counters are not updated by this action on the app. There is an task that will land in a separate PR to add this enhancement in the app reader.
Note 4: a small deviation from design is that I kept 16dp right edge as the left side in the bottom sheet instead of the 14dp (pinging @mattmiklic for a quick check on this and other things he may notice eventually 🙇 )
To test
The feature is behind the
UNREAD_POSTS_COUNT
feature flag. You need to build the wasabiDebug flavor from sources or use the APK from this PR CI build remembering to activate the feature inApp Settings -> Test Feature Configuration
(IMPORTANT: remember to restart the app after changing these flags configuration)Checking the feature
https://wordpress.com/read
and check the counters are coherentChecking big numbers abbreviation
k
,M
etc...Evaluate and Log
breakpoint like below inSiteViewHolder
Line 35 with this configthis.itemUnseenCount.text = statsUtils.toFormattedString(123456L, ONE_THOUSAND)
Smoke testing without the feature enabled
App Settings -> Test Feature Configuration
and restart the appPR submission checklist:
RELEASE-NOTES.txt
if necessary.