Page MenuHomePhabricator

[L] Add Donate slide for Year in Review, adjust slide component, create Learn more webview
Closed, ResolvedPublic

Assigned To
None
Authored By
HNordeenWMF
Sep 30 2024, 7:31 PM
Referenced Files
F57664364: Screenshot 2024-10-31 at 1.05.37 PM
Oct 31 2024, 6:06 PM
F57663877: image.png
Oct 31 2024, 3:12 PM
F57663875: image.png
Oct 31 2024, 3:12 PM
F57663873: image.png
Oct 31 2024, 3:12 PM
F57663871: image.png
Oct 31 2024, 3:12 PM
F57663868: image.png
Oct 31 2024, 3:12 PM
F57656867: image.png
Oct 29 2024, 9:15 PM
F57656863: image.png
Oct 29 2024, 9:15 PM

Description

Background

The Apps team plans to explore if a personalized Wikipedia Year in Review feature that displays insights about a user's reading history, editing history, and donation history is engaging for App users, and inspires them to make a donation to the Wikimedia Foundation.

Subtasks

T378838: [M] Donate Slide - Display personalized or collective slide
T378839: [M] Donate slide - push to Learn More web view
{T378842}

Requirements

Create collective slide

  • Display if we do not have a donation stored for the user
  • "Donate" in top left corner launches donation flow similar to other slides
  • "Done" and "Finish" should dismiss and show the survey (survey will be done as a part of T376319)
  • Link in text "Learn more about what we do" launches in-app webview with donation button

Create personalized slide

  • Display if we do have a locally stored donation for the user
  • "Finish" and "Done" should lead to the survey (survey will be done as a part of T376319)
  • Link in text "Learn more about what we do" launches in-app webview. Nice-to-have: remove donation button from this version

Create Webview of MediaWiki "Learn more" page

Add donate slides to Config

  • Allow us to toggle the donation slides (one setting for both collective and personalized) on and off if needed. We want to be able to support a situation where we want to hide the donation slides from a list of countries
Designs (Figma)

Collective Flow (Non-donor)

image.png (1×786 px, 519 KB)
image.png (1×786 px, 277 KB)
image.png (1×786 px, 222 KB)

Personalized Flow (donor)

image.png (1×786 px, 567 KB)
image.png (1×786 px, 291 KB)
Engineering Notes

Note: Crossed out sections represent remote config adjustments that do not need to be made until after V1.

  1. Allow the slide UI component to display links in the body text. It may just be a matter of passing in markup (see Apple pay form fine print code).

2. Update remote feature config to allow for both personalized slides and collective slides. Each slide will have an isEnabled switch and an "excludeCountries" array. Update existing slide code to check for these things.

  1. Upon app resume method, create persisted slide object for both the personalized slide and collective slide personalized donate slide. Set slide data, and evaluated/display flags if there is local donation history. Reference exclude countries array when setting display as well.
  2. Ensure that when we create the view models before presenting slides (see T376044), fetch the persisted model from previous bullet point. Insert the personalized or collective slide view models depending on their persisted slide display values.
  1. Upon tapping "Finish", dismiss year in review. Ensure survey is still presented properly if we have completed T376319 already.
  1. In SinglePageWebViewController, add a property needsDonateOverlay boolean property. If this property is true, add donate button overlay upon SinglePageWebViewController appearance. Note, we already have a donationCompleteButtonContainer and donationCompleteButton (this displays "Return" on the thank you page) that we can reference, but I would like to set these up as new computed UI properties. Display this button in SinglePageWebViewController's viewDidAppear if property is true (reference setupDonationCompleteView for how to add the overlay to the hierarchy).
  1. Upon tapping "Learn more about our work", present SinglePageWebViewController with https://www.mediawiki.org/wiki/Wikimedia_Apps/About_the_Wikimedia_Foundation url, set needsDonateOverlay property to true.
  1. When Donate button from step 5 is tapped, create a DonateCoordinator instance and call it's start method. You may need to send in a block that sets the donate overlay button to a spinner, as well as send in the button rect target.

Related Objects

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
Tsevener updated the task description. (Show Details)
Tsevener updated the task description. (Show Details)
HNordeenWMF renamed this task from Donate Closing screen component for Wikipedia in Review to Donate Closing screen component for Year in Review.Oct 4 2024, 3:21 PM
HNordeenWMF updated the task description. (Show Details)
Tsevener renamed this task from Donate Closing screen component for Year in Review to Add Donate slide for Year in Review, adjust slide component.Oct 4 2024, 3:33 PM
Tsevener updated the task description. (Show Details)
Tsevener updated the task description. (Show Details)

Estimating without the nice-to-haves.

Tsevener renamed this task from Add Donate slide for Year in Review, adjust slide component to [L] Add Donate slide for Year in Review, adjust slide component.Oct 4 2024, 3:41 PM
HNordeenWMF renamed this task from [L] Add Donate slide for Year in Review, adjust slide component to [L] Add Donate slide for Year in Review, adjust slide component, create Learn more webview.Oct 22 2024, 10:36 PM
HNordeenWMF updated the task description. (Show Details)

@HNordeenWMF

"Learn more about our work" on both slides launches an in-app webview of the MediaWiki page:
Navigating "Back" from Webview should land the user back on the Collective/Personalized donation slide

For smoothest implementation, we would need to at least dismiss YiR first, to avoid a rabbit hole in the middle of year in review. Also due to the custom navigation bar in our in-app web view, which will not play nicely coming from YiR which does not use our custom navigation bar. Is that a nonstarter? I discussed this a little bit more in https://phabricator.wikimedia.org/T377899#10259536.

This remains a Large after re-estimation.

@Tsevener Dismissing YiR first before presenting the webview seems fine here, since it's the last slide.
When they navigate "Back" from the Webview, they would land on whichever screen they were before opening YiR? I also want to ensure they would see the Survey T376319

@HNordeenWMF

When they navigate "Back" from the Webview, they would land on whichever screen they were before opening YiR?

Good question, we discussed automatically re-presenting the YiR flow and immediately showing the last slide if they tap back. Let me know if that makes sense or feels weird. I put it in my engineering notes.

If we can get that process working well, I think we should try to incorporate it in the Donate flow as well, since we have to dismiss before we navigate to the donate flow (like we do with Profile).

HNordeenWMF raised the priority of this task from Low to Medium.EditedOct 25 2024, 7:43 PM

Good question, we discussed automatically re-presenting the YiR flow and immediately showing the last slide if they tap back. Let me know if that makes sense or feels weird. I put it in my engineering notes.

That makes sense to me! Re-presenting the last slide is most ideal, but if you run into a roadblock trying to implement it, I'm fine with just the previous screen.

Somewhat blocked on T378491, but the webview portion of this could be picked up before then.

I am adding my comment from T376046#10274452 here as well for visibility:

Thanks @Tsevener. Per the conversation today with @HNordeenWMF, I reviewed this to see if the flow works. I think it does work (for V1), so I’m moving it to the next column.

In the future, I suggest including the donation views (apple pay and web view) to a modal and stack it on top of the current view:

image.png (2×4 px, 1 MB)

It makes going back to the core flow easier for users.

Questions from sync (@HNordeenWMF):

  • Are we no longer showing "thank you for your contribution" if they edited but did not donate?
  • Can we keep the donate button on last slide but remove it from in-app web view? Would save us two additional pieces of work. If we must have donate on in-app web view, can it only navigate to web donate flow (not native apple pay). Estimate assuming no.

Navigating "Back" from Webview should land the user back on the Collective/Personalized donation slide

We're going to try presenting this web view on top (so they don't lose their place in YiR). In this case they will be tapping an X to get back to YiR, just an FYI.

Allow us to toggle the donation slides (one setting for both collective and personalized) on and off if needed. We want to be able to support a situation where we want to hide the donation slides from a list of countries

Do we also need to hide the red "Donate" button on every slide if we don't want to solicit donations from certain countries? Estimate assuming no.

Subtasks:

  1. M - One (data and UI) to fetch local donation history, persist in data slide report, reference data slide report, create appropriate view model depending on slide display state and data donation count value. Ensure link in UI displays properly (proper theming).
  2. M -Present web view after tapping link, add donate button to web view, navigate to donate flow after tapping donate button. (Could reduce to S if we reload directly to web view donate form instead of native apple pay option).
  3. S - Updating remote config to allow turning off donate slide for certain countries. Ensure config is referenced when calculating report data.

One more question @HNordeenWMF :

Screenshot 2024-10-31 at 1.05.37 PM (854×409 px, 154 KB)

Can we hide the search icon on these web views? To limit their temptation to go down a article search rabbit hole from this context.

Are we no longer showing "thank you for your contribution" if they edited but did not donate?

Correct. The "thank you" slide is only being shown to those who have donated. This made sense to change when we moved the "Learn how to participate" off of the final slide, and onto the editing slide: https://phabricator.wikimedia.org/T377899

Can we keep the donate button on last slide but remove it from in-app web view? Would save us two additional pieces of work. If we must have donate on in-app web view, can it only navigate to web donate flow (not native apple pay). Estimate assuming no.

The only reason we want to display the Donate button on the in-app webview is to allow for folks to do Native ApplePay donations / Web donations that are attributed to Year in review. If that is a big scope add to allow Native ApplePay to launch from the Webview, then we can explore a second option, like having a link to donate within the MediaWiki text, that (hopefully) contains the ID.

Navigating "Back" from Webview should land the user back on the Collective/Personalized donation slide
We're going to try presenting this web view on top (so they don't lose their place in YiR). In this case they will be tapping an X to get back to YiR, just an FYI.

Sounds good

Allow us to toggle the donation slides (one setting for both collective and personalized) on and off if needed. We want to be able to support a situation where we want to hide the donation slides from a list of countries
Do we also need to hide the red "Donate" button on every slide if we don't want to solicit donations from certain countries? Estimate assuming no.

No, we do not need to hide the Red Donate for certain countries. On Web & in the apps currently, the donation options are not hidden from people in those countries.

Can we hide the search icon on these web views? To limit their temptation to go down a article search rabbit hole from this context.

Let's not worry about this, per our conversation in Combined today.

@HNordeenWMF

The only reason we want to display the Donate button on the in-app webview is to allow for folks to do Native ApplePay donations / Web donations that are attributed to Year in review. If that is a big scope add to allow Native ApplePay to launch from the Webview, then we can explore a second option, like having a link to donate within the MediaWiki text, that (hopefully) contains the ID.

Sounds good. That subtask is estimated at a Medium (https://phabricator.wikimedia.org/T376073#10282162). I think we could try middle-ground here, if it's acceptable to you, to reduce some scope. We still display an in-app web view of the "learn more" url with "Donate" button on top. When they tap donate, we immediately reload that same web view with https://donate.wikimedia.org/, passing in the YiR campaign ID. We think that would reduce that subtask to a small.

The downside is they wouldn't get a Native Apple Pay option. We would essentially bypass the payment method action sheet and reload the web view immediately to what the "Other payment method" url would send the user to. They could still use Apple Pay through the web view.

@Tsevener I'm fine with that middle-ground, while Native ApplePay would be more ideal, with that method we could still track the donations to this feature.

@HNordeenWMF Ok thanks - sorry for flip flopping but in looking at the code to write out engineering notes, I actually think might be easier if we keep it as originally asked (payment method action sheet appears after tapping donate button, then we let the donate flow take over, including pushing to the the native apple payment form). We will keep you posted on which approach we took, depending on what was easier.