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 time spent reading this week in hours and minutes.
- Resetting time spent for the week should be based on local device timing
- Calculate a week as the past 7 days
- Show time spent even if they have 0 minutes
- Header should include user name
- Include "On Wikipedia iOS"
Designs
Reference
Android implementation: T399750
Engineering notes
Part 1: Create empty feature
- Create developer settings toggle for this new activity tab experience.
- Create new set of classes to display activity tab. ActivityTabCoordinator (within Wikipedia), ActivityTabHostingController (within WMFComponents package), ActivityTabView (within WMFComponents package), ActivityTabViewModel (within WMFComponents package), ActivityTabDataController (within WMFData package). Rename old experiment classes to something else (but do not delete) if they are named the same.
- If developer settings toggle is on, use ActivityTabCoordinator to replace the History tab with this new ActivityTabHostingController.
- Username should be determined from the outside and passed into the WMFComponents feature. Previously we have used MWKDataStore within the coordinator to grab the username before we pass it into the feature.
Part 2: Task requirements
- In ActivityTabDataController, add method that internally calls WMFPageViewsDataController's fetchPageViewMinutes method to get read minutes for the last 7 days.
- Have view model call ActivityTabDataController's method to read last week's read minutes, present data in ActivityTabView view.
- Make it match Figma with gradient.
QA Notes
- Test in TestFlight Wikipedia 7.8.5.
- Enable Developer Settings toggle Show Activity Tab.