Page MenuHomePhabricator

Enums in select don't display zid when uselang=qqx
Closed, ResolvedPublicBUG REPORT

Description

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

What happens?:

photo_2024-06-21 14.59.21.jpeg (503×485 px, 29 KB)

What should have happened instead?:

enums in select show their zid

Event Timeline

Also while you're at it, there should be 13 items on the list but there are only 10.

Also while you're at it, there should be 13 items on the list but there are only 10.

oh, from the telegram group i thought that it was solved. it seems not, i filed T368153: select for enums show only 10 items when the total amount is 13

DSmit-WMF changed the task status from Open to In Progress.Jul 16 2024, 2:28 PM
DSmit-WMF claimed this task.

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

[mediawiki/extensions/WikiLambda@master] ZObjectSelector: Enums in select don't display zid when uselang=qqx

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

If we are changing this behavior for enums, we should also replicate this for non-enums (when ZObjectSelector is used to choose among normal types).

See https://wikifunctions.beta.wmflabs.org/wiki/Special:CreateObject?uselang=qqx

When typing something in the type selector (e.g. "mon"), the options are displayed with their localized labels

Screenshot from 2024-07-22 13-22-43.png (350×419 px, 33 KB)

My suggestion is to also follow the qqx rule to display all values, and use the supporting text to show the matching label:

Screenshot from 2024-07-22 13-23-33.png (456×358 px, 33 KB)

We can have a method that makes this decision depending on the user selected language and returns either label or "(zid)", and re-use that for the enum label, the lookup label, and the lookup type:

In getLookupResults:

// Set up codex MenuItem options                                                           
// https://doc.wikimedia.org/codex/latest/components/demos/menu-item.html                  
const value = result.page_title;                                                           
const label = this.labelOrZid( value, result.label );                                      
const description = this.labelOrZid( result.page_type, result.type_label );                
const supportingText = ( label !== result.match_label ) ? `(${ result.match_label })` : '';
...

And in enumValues:

return this.getEnumValues( this.type ).map( ( item ) => {
  const value = item.page_title;
  const label = this.labelOrZid( value, item.label );
  return { value, label };
} );

Change #1054581 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] ZObjectSelector: Enums in select don't display zid when uselang=qqx

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