####Background
The Apps team plans to explore if a personalized Wikipedia 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.
####Requirements
- Show total edits for 2024 up to 500, for their primary language wiki in the App
- Display 500+ if they have more than 500 edits
- Reverted edits do not need to be removed
- Only display edits from the article namespace
- Only display if user has 1 or more edits
- Only show to logged-in users
- If user has no edits, or is not logged in, show collective slide
Nice to have
- Show primary language code in dynamic illustration
- Additional sentence that mentions up to 3 article names: //Articles you edited included: "Polar Bear", "Swiss Alps", "Goat"//
####Designs
| {F57583385} | {F57598612}
| Personalized | Collective
####Engineering Notes
- (data part 1) In the WMFYearInReviewDataController, add a method that fetches the user's contributions from their primary wiki, calculates a total count of edits for the year and returns that count.
- The method should allow passing in username and the primary app project from the app-side.
- The method should construct the API URL correct parameters using the username. Also pass in a `ucstart` date of November 1st 2024 and a `ucend` date of January 1st 2024.half) Upon app resume, Bonus points if you can pull these dates from the WMFDeveloperSettingsDataController's remote config `dataPopulationStartDateString` and `dataPopulationEndDateString` valuespull persisted slide item object for this slide identifier. You should also send `ucnamespace` of 0 and `ucprop` values of `ids|title|timestamp|tags|flags` (here we are asking only for edits in the Article namespaceIf evaluated = no, i.e.they are logged in, AND remote config does not talk page edits.have a personalized slide kill switch, Also explicitly asking for edit tags and flags in case we eventually need to filter out certain edits from the count.)
- Example API call - `proceed with fetching their global edit count and registration date ([[ https://en.wikipedia.org/w/api.php?action=query&format=json&list=usercontribs&formatversion=2&uclimit=500&ucstart=2024-11-01T22%3A20%3A13.000Z&ucend=2024-01-01T22%3A20%3A13.000Z&ucuser=TSevener%20(WMF)&ucnamespace=0&ucprop=ids%7Ctitle%7Ctimestamp%7Ctags%7Cflags`
- You can reference the `WMFGrowthTasksDataController` [[ https://github.com/wikimedia/wikipedia-ios/blob/main/WMFData/Sources/WMFData/Data%20Controllers/Growth%20Tasks/WMFGrowthTasksDataController.swift#L28 | getImageRecommendationsCombined ]] method as an example of how to construct an API url with parameters and fetch it using our mediawiki service class.
- The method should use our media wiki service to fetch the data. Use Codable to parse through the response.
- The method should get a count of all edits returned in the `usercontribs` array.
- The method should also check to see if there are more edits or not. Do this by checking to see if a "uccontinue" key and value is returned at the top of the response. You can see what this object looks like if you change the `uclimit` to 10 in the above API call.
- The method should return the final edit count and a boolean whether there are more edits or not.
- (data part 2, blocked on T376041) Upon app resume, pull persisted slide item object for this slide identifier. If evaluated = no, they are logged in, AND remote config does not have a personalized slide kill switch, call method in previous bullet pointaction=query&format=json&meta=globaluserinfo&formatversion=2&guiprop=editcount | example ]]). Store returned data in persisted report model from T376041. Then set evaluated = yes for persisted report model. If edit count > 0, set display = yes for persisted report model. Save modelset display = yes.
- (UI half) Ensure that when we create the view models before presenting slides (see T376044), fetch the persisted model from previous bullet point. If display = yes, build a slide view model withfor this data (using the report model's metadata). Ensure slide view model is inserted into the correct order, and that associated collective "fallback" slide is NOT inserted.