Autosuggest templates in advanced parameters form
Open, NormalPublic5 Story Points

Description

As a user,
I want some help to pick templates which searching,
so that when I search, I get valid results

Acceptance Criteria:

  • The UI Widget where I select templates shows a list of available templates when it has focus and i started to type the first letter.
  • The UI Widget shows only the templates that match the text that is already typed.
  • When a template from the list is selected, it becomes a "pill" inside the UI widget.

Background:
This needs to be implemented as a custom widget. Since MenuTagMultiselectWidget expects a fixed number of options and loading ALL the templates into memory would cost too much memory and bandwidth, it's better to subclass TagMultiselectWidget and use the LookupElement mixin to provide the menu.

The API endoint is opensearch. An example query for the German Wikipedia for all templates beginning with "Burg" looks like this:
https://de.wikipedia.org/w/api.php?action=opensearch&format=json&formatversion=2&search=Burg&namespace=10&limit=100&suggest=true

Related Objects

Lea_WMDE renamed this task from Search prototype: Autosuggest templates to Autosuggest templates in advanced parameters form.May 30 2017, 4:45 PM
Lea_WMDE moved this task from Backlog to MVP on the Advanced-Search board.Jun 7 2017, 2:42 PM
gabriel-wmde set the point value for this task to 5.Jul 12 2017, 12:24 PM
Restricted Application added a project: WMDE-Fun-Team. · View Herald TranscriptJul 12 2017, 4:14 PM
gabriel-wmde updated the task description. (Show Details)Jul 12 2017, 4:49 PM

@daniel Some questions:

  1. is the suggested API endpoint the right one for the "completionSearch" you mentioned?
  1. CompletionSuggester, states that it does not support querying namespaces with the completion algorithm, other than the main one? This matches the results I get with the API. When I use namespace 10 (templates), I only have a prefix search, for namspeace 0 (Main) I get full title search. Any idea on how to activate the algorithm for different namespaces?
gabriel-wmde claimed this task.
gabriel-wmde updated the task description. (Show Details)Sun, Aug 6, 4:51 PM
gabriel-wmde removed gabriel-wmde as the assignee of this task.Mon, Aug 7, 5:16 PM
Pablo-WMDE claimed this task.

I had uploaded it as Draft because it's a WIP, not knowing that I have to add you as reviewers so you can see it. Now I've added you.

Addressed that the search apparently is only triggered once.

Pablo-WMDE added a comment.EditedThu, Aug 17, 8:54 AM

As it was discussed for the namespaces... was there a decision on how we deal with suggestions already present as pill? Should suggestions be shown for them? (/cc @gabriel-wmde @Lea_WMDE @Charlie_WMDE)

Working on a secondary PR that prevents update events emitted from store when no actual change happened - helps us avoid boilerplate (loop-preventing) code in all subscribers.

Pablo-WMDE added a subscriber: Pablo-WMDE.

@gabriel-wmde Please take a look at https://gerrit.wikimedia.org/r/#/c/373035/, see if you think this could be worthwhile (maybe with further additions, hence WIP).