Background
The team is testing an activity tab that would add reading insights to existing history tab with the goal of deepening engagement and increasing retention of readers.
Requirements
- Show total articles that were saved or saved to a reading list this month (Month = Last 30 days)
- Show date of last saved article in local time format. If it was the current day, show timestamp.
- Month should be based on device's local time
- Show article images if availalbe
- If there is no article image, it is acceptable to not show a circle for the article
- Tapping on the module should take the reader to the Saved tab
- If there is no Saved history, keep the module and show "0" (Empty state CTA will be added on separate ticket T407672)
Designs
Reference
Android implementation: T399748
Engineering notes
- (5) Fetch Data. The goal here is to clean things up so that we don't have to pass in saved data fetching closures from the coordinator. The WMFData ActivityTabDataController should be able to fetch saved article data internally.
- Cleanup:
- Bump Wikipedia.xcdatamodel, add isSavedMigrated boolean to WMFArticle
- Bump WMFData.xcdatamodel, add savedDate to WMFPage (or create a new entity with saved metadata and create a 1-to-1 relationship with WMFPage).
- Create an operation class that regularly fetches WMFArticle items that have isSavedMigrated = false, for each item, copy over the savedDate to WMFData object. Mark isSavedMigrated = true when done.
- Whenever old legacy saves an article, go ahead and keep it adding a "savedDate" in WMFArticle, but in the same spots also update the WMFData fields.
- Fetch new data:
- Activity tab saved articles module should only fetch saved information from WMFData (consider creating a shared SavedArticleDataController to pull this, in the future we will reference this data controller for everything related to saved articles).
- For getting article summaries (I.e. the image for the saved article module circles)...just try fetching the image from existing WMFArticleSummaryDataController. There's no built-in summary cache like the old legacy code, but I think the network stack will already be able to cache this internally fairly well. Let's see how it acts naturally without extra caching for now.
- Cleanup:
- Create UI
- Navigate to saved tab upon tap