Page MenuHomePhabricator

There should be a way to add a tool to a list from any of the tool views
Closed, ResolvedPublicFeature

Description

As a user, I would like to add a tool to either an existing list, or to a new one created on the fly, from any of the available tools views, e.g. when viewing a tool card, or when viewing the info for a tool.

This type of feature is ubiquitous in course catalogs, hotel and airbnb listings, and more. The screenshots below are from Udemy and show what the feature typically looks like.

  1. A dropdown menu with the option to create a new list
  2. A modal window for list creation
  3. The same dropdown menu, but now featuring an existing list. The green checkmark indicates that the list contains the selected course.

Screenshot 2022-01-11 at 12.38.36.png (690×1 px, 467 KB)
Screenshot 2022-01-11 at 12.39.17.png (816×1 px, 145 KB)
Screenshot 2022-01-11 at 12.54.00.png (692×714 px, 108 KB)

Event Timeline

bd808 triaged this task as Medium priority.Jan 29 2022, 12:13 AM
Slst2020 changed the task status from Open to In Progress.Feb 1 2022, 8:10 AM

I'm currently working on creating design mock-ups to show what this feature could look like in Toolhub.

A prototype in Figma can be seen here: link

There are two different flows that can be selected from the menu on the left: adding a tool to an existing list, and creating a new list directly from the menu.
If you click anywhere on the page, you will get a hint on where to click next.

Some icons/minor details are missing from the design. This was just to save time, as I preferred not to fiddle too much with it.

Link to the Figma design file:
https://www.figma.com/file/byynyFZJz3AFljqBHTx1D1/Add-tool-to-list-UI?node-id=0%3A1

I guess it will be necessary from a best-practices perspective to add PATCH endpoints for adding/removing a specific tool to/from a list, vs. the option of using the existing PUT endpoint. What do you think?

I guess it will be necessary from a best-practices perspective to add PATCH endpoints for adding/removing a specific tool to/from a list, vs. the option of using the existing PUT endpoint. What do you think?

With the current endpoints the reasonable implementation would be something like GET /api/lists/{id}/ to get the full info followed by PUT /api/lists/{id}/ using data from the GET plus the change to tools array that is desired.

New endpoints to remove the need for the initial fetch might look something like:

  • PUT /api/lists/{id}/tools/{name}/ -- add tool identified by {name} to the end of the list
  • DELETE /api/lists/{id}/tools/{name}/ -- remove tool identified by {name} from list

An open question would be what error codes (if any) should be returned from those endpoints when the thing being added is already there or the thing being removed is already gone. It would seem reasonable to me that both return "204 No Content" on success.

Alternately, the fetch-change-update cycle needed with the current API endpoints could be encapsulated in vuex methods to hide the complexity.

If you can think of any other functionality you would like to see as a part of the dropdown list that will be attached to every ToolCard as well as to the ToolInfo page, this may be the time to speak up!

Slst2020 changed the task status from In Progress to Open.Mar 2 2022, 9:40 AM
Slst2020 moved this task from Doing to Done on the User-Slst2020 board.

Change 772407 had a related patch set uploaded (by Slavina Stefanova; author: Slavina Stefanova):

[wikimedia/toolhub@main] ui: Add menu to ToolCard and ToolInfo

https://gerrit.wikimedia.org/r/772407

Change 772407 merged by jenkins-bot:

[wikimedia/toolhub@main] ui: Add menu to ToolCard and ToolInfo

https://gerrit.wikimedia.org/r/772407

Change 786342 had a related patch set uploaded (by BryanDavis; author: Bryan Davis):

[operations/deployment-charts@master] toolhub: Bump container version to 2022-04-21-215651-production

https://gerrit.wikimedia.org/r/786342

Change 786342 merged by jenkins-bot:

[operations/deployment-charts@master] toolhub: Bump container version to 2022-04-21-215651-production

https://gerrit.wikimedia.org/r/786342