Page MenuHomePhabricator

FunctionEditor: I cannot choose function calls which returning types as input or output types of functions
Closed, ResolvedPublicBUG REPORT

Description

Description

This means that I cannot have a list or a pair as a input or output of a function.

Steps to reproduce:

  1. Go to https://wikifunctions.beta.wmflabs.org/wiki/Special:CreateZObject?zid=Z8
  2. In input type or output type, write "Typed"

Observed behavior:

  • No typed list comes as option
  • This means that no Z8 returning a Z4 is returned in this ZObjectSelector, only persisted objects of type Z4

Expected behavior (Acceptance criteria):

  • Typed list or Typed pair should be available for selection as input or output types
  • When searching for a persisted object to select as input or output type, the request shouldn't ask only for type=Z4, but also returnType=Z4 so that also functions returning types are presented as options

Devices and Design (URLs or screenshots)

https://www.figma.com/file/Q6EG8mLJFhxw99HpffHSZe/T326301-Typed-list-as-function-input-or-output?node-id=518%3A39808&mode=dev


Completion checklist

Event Timeline

Jdforrester-WMF renamed this task from FunctionEditor: I cannot choose function calls returning types as input our output types of functions to FunctionEditor: I cannot choose function calls which returning types as input or output types of functions.Jan 5 2023, 4:39 PM
Jdforrester-WMF subscribed.

This is the use case we have the mode selector for, but we dropped it from the function editor design; should we re-add it?

Yes, we will need a mode selector here.

This should be built once we have the default component back. Thus moved to G9.

AAlhazwani-WMF changed the task status from Open to In Progress.Sep 29 2023, 9:17 AM
AAlhazwani-WMF claimed this task.

early design proposal available at https://www.figma.com/file/Q6EG8mLJFhxw99HpffHSZe/T326301-Typed-list-as-function-input-or-output?type=design&node-id=110%3A20430&mode=dev

questions from engineering

  1. how to set up an input type as a typed list?
    • the proposal would be to use the same type selector, and display all objects that return Z4
      image.png (662×1 px, 95 KB)
  1. how to select the type of list items?
    • based on the selected type, we would display the additional required inputs just below the type selector
      image.png (990×2 px, 131 KB)
  1. edge case; nested lists: How to set up an input type as a typed list of typed lists?
    • same as above
      image.png (1×1 px, 131 KB)
  1. edge case; revert: After setting up an input type as a typed list, how do I change it back to a referenced type?
    • function creators can focus the type selector and pick a different object that returns a Z4
  1. how are input/output types shown in the Function Viewer details tab when they are function call defined types?
    • as a first iteration, we could rely on the existing solution that we use for function calls
      CleanShot 2023-10-04 at 18.19.23@2x.png (1×1 px, 172 KB)
  1. how are input/output types shown in the Function Viewer details tab when they are function call defined types?
    • as a first iteration, we could rely on the existing solution that we use for function calls
      CleanShot 2023-10-04 at 18.19.23@2x.png (1×1 px, 172 KB)

edited message above.

gengh updated the task description. (Show Details)
gengh updated the task description. (Show Details)
gengh added a subscriber: AAlhazwani-WMF.

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

[mediawiki/extensions/WikiLambda@master] Add generic type list selector for function inputs and output

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

Change 969718 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] Add generic type list selector for function inputs and output

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