Page MenuHomePhabricator

select for enums show only 10 items when the total amount is 13
Closed, ResolvedPublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

What happens?:

there are only 10 enums in the select while there are 13 objects of that type https://www.wikifunctions.org/wiki/Special:ListObjectsByType/Z16927

What should have happened instead?:

display all enums for that type

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):


Expected behavior (Acceptance criteria):

We will use CdxSelect load-more event to notice when the user scrolls to the bottom of the select component. If the API request had more pages, request the next one and add the items to the enums store collection.

  • Enum values should be shown using CdxSelect component
  • Enums will be paginated (limit=10)
  • When reaching the end of the selector, it should add the following batch of items

Event Timeline

i was able to replicate this also with the "Gregorian calendar month". go to https://www.wikifunctions.org/view/en/Z13163, the select only displayed 10 out of 12 available object https://www.wikifunctions.org/wiki/Special:ListObjectsByType/Z16098

Another question - the order in which the items (i.e. months) are displayed is alphabetical on Special:ListObjectsByType/Z16098 and the order in the drop-down menu on Z13163 is difficult to identify.

It might be confusing to users to search for a month in the drop-down to make a correct selection.

Another question - the order in which the items (i.e. months) are displayed is alphabetical on Special:ListObjectsByType/Z16098 and the order in the drop-down menu on Z13163 is difficult to identify.

It might be confusing to users to search for a month in the drop-down to make a correct selection.

See: T368497: select for enums should be in sensible order

If there are many options to choose (e.g. natural languages), then a simple drop-down is not really appropriate. Based on how Wikidata implement drop-down, the features needed are:

  • Change the selector to a input-and-select box, where user can input text and get relevent enum entries. User can directly a ZID to input-and-select box too; and if user input nothing, the behavior would be similar to the current one (all possible choices are displayed)
  • (whether user input anything or not) In the selector, a "more" link will be shown which will load more choices without going to another page.

If there are many options to choose (e.g. natural languages), then a simple drop-down is not really appropriate.

agreed, as a first iteration we opted for the simpler select/drop-down approach. something that we'd like to explore as we continue to observe how people create/use different types of enums is if we can programmatically display a select if enums are for example less than 15*, or display a combobox if they are more than 15.

*this is an arbitrary number, definitely TBD

DSmit-WMF changed the task status from Open to In Progress.Jul 16 2024, 10:48 AM
DSmit-WMF claimed this task.

@AAlhazwani-WMF @gengh Do you think we need a loading indicator here?

also I think we do need some error handling aswell that is currently also not there. But maybe I should not increase the scope of this ticket and handle that perhaps in a seperate phab ticket

Change #1054524 had a related patch set uploaded (by Daphne Smit; author: Daphne Smit):

[mediawiki/extensions/WikiLambda@master] [WIP] ZObjectSelector: select for enums show only 10 items when the total amount is 13

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

Change #1054524 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] ZObjectSelector: select for enums show only 10 items when the total amount is 13

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