Page MenuHomePhabricator

DefaultView - ZObjectType: When literal type is selected but key is not bound, show selected type and the option for other literal
Closed, ResolvedPublic

Description

Description

The ZObjectType allows the contributor to select type/mode for a key-value.

When the key is bound to a type, the "literal" option means the bound or selected type:

Screenshot from 2023-02-27 10-58-12.png (241×555 px, 12 KB)

However, when the key is not bound to a type, the "literal" options shows the selected type if any:

Screenshot from 2023-02-27 10-56-53.png (245×554 px, 13 KB)

And "Object" when the field is blank or a non-literal option is selected:

Screenshot from 2023-02-27 10-59-17.png (238×539 px, 13 KB)

This means that when we have a literal type selected for a key that allows any type, changing the type requires a number of steps:

  • Select a non-literal option (e.g. Reference)
  • Select the literal "Object" option
  • Select the type

One solution we can easily incorporate is:

When a literal type is selected for a non-type-bound key, show both literal options in the dropdown:

  • Currently selected literal type
  • Object (untyped) literal type

Desired behavior/Acceptance criteria

  • Changing the type of a key-value that's non-type-bound should be easier and more explicit

Completion checklist

Event Timeline

gengh renamed this task from ZObjectType: When literal type is selected but key is not bound, show selected type and the option for other literal to DefaultView - ZObjectType: When literal type is selected but key is not bound, show selected type and the option for other literal.Feb 27 2023, 10:26 AM

Change 907455 had a related patch set uploaded (by Genoveva Galarza; author: Genoveva Galarza):

[mediawiki/extensions/WikiLambda@master] Add selected and bound options to ZObectType selector for simplifying type change

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

Change 907455 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] Add selected and bound options to ZObectType selector for simplifying type change

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

DVrandecic subscribed.

Tested it out with a few test types. I could change the type on a key that had object, but not on a key that had a specific type given. Works as intended.