Page MenuHomePhabricator

TitlesMultiselectWidget does not suggest exact matches
Closed, ResolvedPublic5 Estimated Story Points

Description

Original Report
In order for a partial block to work, you have to choose the title from an auto-suggest popup. Unfortunately, the auto-suggest popup only triggers after you type at least 2 letters. This makes it hard to block people from 1-letter pages, like A, B, or C. You can work around the bug by typing 2 letters and then hitting backspace.

This will probably require a tweak to the OOUI widget, maybe creating a new parameter for overriding the regular trigger behavior.

Problem
If you type a string like A the browser will make a request like this:
https://test.wikipedia.org/w/api.php?action=query&format=json&prop=info%7Cpageprops&generator=prefixsearch&gpssearch=A&gpslimit=10&ppprop=disambiguation&redirects=true
however, since there is an exact match, it shows nothing in the drop down. This is confusing because the user cannot know if they made an exact match (and can press return), or if they are still waiting on results.

Solution
Exact matching results should not be filtered out (or provide a config option in TagMultiselectWidget).

Event Timeline

Note that partial blocks are only currently enabled on Test Wikipedia.

TBolliger triaged this task as Low priority.EditedNov 6 2018, 9:36 PM
TBolliger moved this task from Untriaged to Product/Tech backlog on the Anti-Harassment board.

Hitting the return key still submits a 1-character pagename if valid. (I actually used 1-character pages for these test blocks.)

I'll rename this task to make it more clear.

TBolliger renamed this task from Difficult to block users from editing 1-letter pages to TitlesMultiselectWidget does not suggest 1-letter pages.Nov 6 2018, 9:37 PM
dbarratt renamed this task from TitlesMultiselectWidget does not suggest 1-letter pages to TitlesMultiselectWidget does not suggest exact matches.Nov 7 2018, 4:54 PM
dbarratt updated the task description. (Show Details)
dbarratt updated the task description. (Show Details)
TBolliger raised the priority of this task from Low to Medium.Nov 7 2018, 5:11 PM
TBolliger moved this task from Backlog to User blocking on the MediaWiki-User-management board.

Looks like this isn't actually an exact matching problem, or anything affecting 1-character titles exclusively.

If I have a page entitled "Foo", then I type "Foo", "Foo" (exact match) appears in the search results.
If I copy and paste "Foo" into the empty input, no search results are shown (similarly to simply typing "F").

The menu items aren't showing the first time the input is changed, likely because a promise isn't resolving in time.

Change 474735 had a related patch set uploaded (by Tchanders; owner: Tchanders):
[mediawiki/core@master] TitlesMultiselectWidget: toggle menu after adding items

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

Looks like this isn't actually an exact matching problem, or anything affecting 1-character titles exclusively.

If I have a page entitled "Foo", then I type "Foo", "Foo" (exact match) appears in the search results.
If I copy and paste "Foo" into the empty input, no search results are shown (similarly to simply typing "F").

The menu items aren't showing the first time the input is changed, likely because a promise isn't resolving in time.

Oh, good find. Suggest would always find exact and/or 1-character matches if you backspaced 1+ character.

Change 474735 merged by jenkins-bot:
[mediawiki/core@master] TitlesMultiselectWidget: toggle menu after adding items

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

dbarratt moved this task from Review to Done on the Anti-Harassment (AHT Sprint 33) board.