Page MenuHomePhabricator

Remove the double-dropdown situation from the function labels in the function editor page
Closed, ResolvedPublic

Description

When creating a function from scratch, we see two dropdowns, one with a language and no other options, and another one with a CdxLookup over ZLanguage types, with a "Add language" placeholder.
There's also a "+Add labels in another language" button at the bottom

When selecting a language in the "Add language" lookup, it just adds one language to the dropdown in the left, which doesn't seem to make much sense.

According to the figma files:

  • https://www.figma.com/file/z4PDWdNVvwEtRMMozW8Fvi/Function-editor?node-id=1686%3A7760
  • There's only ONE dropdown
  • This dropdown will be initiated with English.
  • The dropdown contains the selected language for the current label.
  • This dropdown is also a lookup component that will perform a search of Z60 objects with the string typed in by the user.
  • When emptied, the dropdown should contain a placeholder that identifies such as "Select language"
  • When a new label is added on the button below, the new "Select language" dropdown shall be empty.
  • It should not be allowed to add two labels with the same language.

Event Timeline

Change 826535 had a related patch set uploaded (by Jkieserman; author: Jkieserman):

[mediawiki/extensions/WikiLambda@master] create function language selector updates and bug fix

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

Additionally I would also recommend to a "Language" label next to the language selector, example screenshot below, and mocks updated in the Figma file mentioned in the task description.

Screen Shot 2022-08-29 at 16.47.15.png (848×1 px, 101 KB)

Thanks, I can make these changes in the existing patch! One small NIT unrelated to this patch...this screenshot has asterisks next to Name and Alias (which usually implies required I believe?) but we actually currently do not require either and have the word (optional) next to them - if this was an intentional change, we should create a separate ticket.

Screen Shot 2022-08-29 at 7.18.55 AM.png (330×1 px, 167 KB)

I also favor the word (optional), let me update the Figma file to reflect what we currently have in code!

Change 826535 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] UX function language selector updates and bug fix

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