Page MenuHomePhabricator

Add Image: Enrich task suggestion list with file names
Closed, DeclinedPublic


This task depends on the final design, but we'll likely want to use the recommended images on the image recommendation task cards, so we need to get that information. There are two ways to do this:

  1. Make GrowthTasksApi.js fetch the recommendation data from the image recommendation API once it has loaded the list of suggested tasks, and use it to populate the thumbnail field. This is somewhat inefficient (as we'll need the exact same data to set up the editing interface) but it only involves minimal changes to the architecture.
  2. Add the images to the search results before they get cached, then use that cached data in the response to the request made by GrowthTasksApi.js, and also when passing recommendation data to the editing UI (via HomepageHooks::onBeforePageDisplay()). This improves client performance but requires more complex changes:
    1. include the ImageRecommendation object (the data obtained from the API) into ImageRecommendationTask;
    2. find a good place to fetch the API data and set the value of those objects, maybe inside the TaskSuggester
    3. change onBeforePageDisplay() to use the task suggester (or the cached task suggester data) to obtain the image recommendation data. This would probably obsolete some of T289025: Add Image: Load recommendation data (an API-based ImageRecommendationProvider service wouldn't be needed anymore).

The first approach is much less complicated and so it seems better for Iteration 1, even taking into account that it means a performance hit (although this might depend on the extent of that performance hit). It's also probably better suited to having an entry point from the reading experience in the future.

Event Timeline

Tgr renamed this task from Add Image: enrich task suggestion list with file names to Add Image: Enrich task suggestion list with file names.Aug 18 2021, 8:49 PM
kostajh triaged this task as Medium priority.Aug 25 2021, 11:36 AM

I'm moving this back to Incoming as it sounds that we might not actually need this.