As a user that works with constraint definitions I would like to get context based suggestions, so I see the semantically correct ( one-of ) items for suggestions better.
GIVEN I am on a property page.
WHEN I add a property 'property constraint' (`Property P2302 on Wikidata`)
AND I focus the input field and enter a search string
THEN I would like to see constraint items higher ranked in the suggestions.
GIVEN I am on a property page.
WHEN I add a property 'property constraint' (`Property P2302 on Wikidata`)
AND I focus the input field and enter 'single'
THEN I would like to see the 'single value constraint' item in the suggestions.
Patches:
[x] [[ https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/Wikibase/+/446775/ | Introduce entity selector search suggestions hook ]]
[x] [[ https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/WikibaseQualityConstraints/+/447783/ | Use hook in quality constraints js module ]]
[x] [[ https://gerrit.wikimedia.org/r/#/c/mediawiki/extensions/Wikibase/+/450013/1/view/resources/jquery/wikibase/jquery.wikibase.entityselector.js | Show default suggestions on focus ]]
Test here:
https://wikidata-constraints.wmflabs.org/wiki/Property:P31