Page MenuHomePhabricator

[SPIKE] Add explore feed card for image recommendations
Closed, ResolvedPublic

Description

Task to investigate inserting a special explore feed card as a point of entry for the image recommendation feature.

Requirements:

  • It should never be the first card (the second after the top read or featured article, depending on the wiki, as some wikis don't have feature article on wikifeeds i.e pt-wiki)

Event Timeline

Some findings:

  • The card should not be an announcement. Announcements stay in the explore feed in the same place they appeared and are usually the first item when they are first displayed. Some announcements are removed when stale, and that's also not the case.
  • We'll need to create a new card for the feature as a subclass of ExploreCardCollectionViewCell. It will allow us to use some of the standard behaviors, such as allowing the user to hide the card.
  • A lot of the changes can be triggered by adding it's own WMFFeedDisplayType and WMFContentGroupKind.
  • We'll have to remove and re-introduce the card every time the explore feed updates with new content. We'll need to evaluate that the feed doesn't contain announcements, "Because you read" and "Continue reading..." cards. We might need to ignore those and then insert the card after the first "regular" explore feed card. After setting up the content on ExploreViewController.setupFetchedResultsController, we can create a separate method to handle the new card (removing it from the feed, if necessary, and reinserting it in the correct place).
  • The ordering is determined by the index path on the collection view in the WMFContentGroup+WMFFeedContentDisplaying.displayTypeForItemAtIndex method, which is called on ExploreFeedViewController.displayTypeAt(indexPath:). The explore feed collection view will call this method on collectionView(_ collectionView: cellForItemAt indexPath:). Since no card on our current feed behaves the way we need, altering this logic might require extra work to maintain the other cards' logic unaltered.