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

[Reader] Implement announcement card #20846

Merged
merged 18 commits into from
May 21, 2024

Conversation

RenanLukas
Copy link
Contributor

@RenanLukas RenanLukas commented May 18, 2024

Fixes #20621

Screenshot 2024-05-17 at 10 25 32 PM Screenshot 2024-05-17 at 10 25 25 PM

Screen.Recording.2024-05-17.at.10.26.02.PM.mov


To Test:

  • Install JP and log in.
  • Make sure the reader_announcement_card feature flag is disabled.
  • Open Reader.
  • 🔍 Verify the announcement card is not shown in any feed.
  • Enable reader_announcement_card feature flag.
  • Open Reader.
  • 🔍 Verify the announcement card appears as expected in all the feeds.
  • 🔍 Tap "Done" button: make sure the announcement card disappears and is never shown again (unless the app data is cleared).

Regression Notes

  1. Potential unintended areas of impact

    • Reader feeds layouts since I had to change a bit the reader_fragment_layout file
  2. What I did to test those areas of impact (or what existing automated tests I relied on)

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

    • Updated ReaderViewModelTest.kt.

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)

@dangermattic
Copy link
Collaborator

dangermattic commented May 18, 2024

3 Warnings
⚠️ strings.xml files should only be updated on release branches, when the translations are downloaded by our automation.
⚠️ This PR is larger than 300 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.
⚠️ Class ReaderAnnouncementCardItemData is missing tests, but unit-tests-exemption label was set to ignore this.

Generated by 🚫 Danger

@RenanLukas
Copy link
Contributor Author

RenanLukas commented May 18, 2024

Reviewer: I have no idea why SonarCloud Quality Gate is complaining about this line.

image

@RenanLukas RenanLukas marked this pull request as ready for review May 18, 2024 01:47
@wpmobilebot
Copy link
Contributor

wpmobilebot commented May 18, 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
Versionpr20846-681ab48
Commit681ab48
Direct Downloadwordpress-prototype-build-pr20846-681ab48.apk
Note: Google Login is not supported on these builds.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented May 18, 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
Versionpr20846-681ab48
Commit681ab48
Direct Downloadjetpack-prototype-build-pr20846-681ab48.apk
Note: Google Login is not supported on these builds.

Copy link

codecov bot commented May 20, 2024

Codecov Report

Attention: Patch coverage is 75.00000% with 9 lines in your changes are missing coverage. Please review.

Project coverage is 40.83%. Comparing base (8255e5b) to head (681ab48).
Report is 18 commits behind head on feature/tags-ia.

Files Patch % Lines
.../java/org/wordpress/android/ui/prefs/AppPrefs.java 0.00% 3 Missing ⚠️
...ss/android/ui/reader/viewmodels/ReaderViewModel.kt 88.46% 3 Missing ⚠️
.../org/wordpress/android/ui/prefs/AppPrefsWrapper.kt 0.00% 2 Missing ⚠️
...ions/insights/usecases/TagsAndCategoriesUseCase.kt 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@                 Coverage Diff                 @@
##           feature/tags-ia   #20846      +/-   ##
===================================================
+ Coverage            40.81%   40.83%   +0.02%     
===================================================
  Files                 1493     1494       +1     
  Lines                68736    68771      +35     
  Branches             11346    11349       +3     
===================================================
+ Hits                 28057    28086      +29     
- Misses               38131    38139       +8     
+ Partials              2548     2546       -2     

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

Copy link
Contributor

@develric develric left a comment

Choose a reason for hiding this comment

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

Hey @RenanLukas 👋 , thanks for the PR 🙇 (also thanks @thomashorta for taking care of the CI issues while Renan was afk 🙇 ).

Code LGTM, I just left a minor np if you want to consider it 🙇

About the card behavior, I'm not sure if this was discussed before (so in case bear with me 🙇) I had 2 thoughts while interacting with it:

  1. By instinct I'd expect it to be part of the stream instead of staying in a fixed position on top while you scroll the feed; OTOH maybe this works in terms of users noticing it 🤔
  2. Should we avoid to show the card in the following scenarios? Of the two scenarios below, what I'm most unsure of is maybe the empty state case (including onboarding "getting started" state).

Empty states, including onboarding
image

image

Blogs or Tagged filtered feeds
image

image -------

Wdyt? I mostly wanted to be sure we considered the items I reported 🙇

fun onAnnouncementCardDoneClick() {
readerTracker.track(AnalyticsTracker.Stat.READER_ANNOUNCEMENT_CARD_DISMISSED)
appPrefsWrapper.setShouldShowReaderAnnouncementCard(false)
loadAnnouncementCard()
Copy link
Contributor

Choose a reason for hiding this comment

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

np: maybe I'd rename this something like setAnnouncementCardState, since in the end we use it for that and in this scope here for example we are not actually loading the cards but setting the "hide" state. wdyt?

Copy link
Contributor

Choose a reason for hiding this comment

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

Good point, that threw me off as well when I worked on the code yesterday. Maybe updateAnnouncementCard would be better.

@RenanLukas
Copy link
Contributor Author

RenanLukas commented May 21, 2024

Thanks for the review, @develric

By instinct I'd expect it to be part of the stream instead of staying in a fixed position on top while you scroll the feed; OTOH maybe this works in terms of users noticing it 🤔

I also thought about it while implementing it and it definitely seems to make sense. The problem is that we have at least three places in the reader that we'd have to implement the card: discover feed screen, tags feed screen (which is the new one) and post list screen, which is basically the other feeds.

Since implementing it in at least three places would significantly increase the effort, I thought the gain we'd have wasn't worth it considering is something shown just once until the user taps "Done". Please let me know if you disagree.

Should we avoid to show the card in the following scenarios? Of the two scenarios below, what I'm most unsure of is maybe the empty state case (including onboarding "getting started" state).

If we're willing to spend time implementing it, yes, it should be possible. I'll have a look at the empty states because we might need some specific logic depending on the screen (like for "Discover", for example).

I'm not sure about the filtered tag/blog scenario, though: if we're showing the announcement card when no filter is selected and the UI is exactly the same (vertical post list), why shouldn't we also show it when a filter is selected and also considering the user is one click away from never seeing it again in case they're annoyed by it?

@daniloercoli
Copy link
Contributor

I also thought about it while implementing it and it definitely seems to make sense. The problem is that we have at least three places in the reader that we'd have to implement the card: discover feed screen, tags feed screen (which is the new one) and post list screen, which is basically the other feeds.

+1 on injecting the card into the feed. (For the record, Posting Prompts will be added into the feed).

To restrict the effort, I think we can limit it to the Discovery feed, as it's where the vast majority of people are in the Reader.

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

Copy link
Contributor

@develric develric left a comment

Choose a reason for hiding this comment

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

As per team slack discussion/alignment, we are merging this PR since it's going into a feature branch and it's still behind an off feature flag. We'll use this as a plan B while exploring having the announcement card injected in the feeds 👍

@RenanLukas RenanLukas merged commit 5dde4db into feature/tags-ia May 21, 2024
21 checks passed
@RenanLukas RenanLukas deleted the issue/20621-tags-feed-onboarding branch May 21, 2024 21:58
@RenanLukas RenanLukas restored the issue/20621-tags-feed-onboarding branch May 22, 2024 03:34
@RenanLukas RenanLukas deleted the issue/20621-tags-feed-onboarding branch May 22, 2024 04:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants