Page MenuHomePhabricator

Frontend: Display Nested Metadata Maps
Closed, ResolvedPublic

Description

Description

Metadata maps may now be nested multiple layers deep. Frontend display needs to handle nested maps, including i18n of nested keys.

Desired behavior/Acceptance criteria

  • nested metadata map keys can be internationalized
  • nested metadata maps can be displayed

Design

See Metadata front-end design challenges in nested metadata design doc, and Figma file for the design specs.

Completion checklist

Event Timeline

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

[mediawiki/extensions/WikiLambda@master] [WIP] Add nested metadata to FunctionMetadataDialog component

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

Tested with the latest orchestrator fixes.

  • We are able to see the menu selector displaying the zObjectKey keys indented properly
  • The zObjectKey keys are labelized properly
  • We are able to select the function call and see its metadata
  • The metadata dialog selection is reset when its closed and re-opened (cc. suggested by @AAlhazwani-WMF)

Screenshot from 2024-06-11 10-18-02.png (572×550 px, 36 KB)

Screenshot from 2024-06-11 10-18-14.png (610×576 px, 45 KB)


Observed issues

Here are some observations of use cases that I'm unable to test. I'm not sure if this is expected or not, so will note everything down and wait for @cmassaro @Jdforrester-WMF to confirm:

  1. There is no nested metadata when the implementation is a composition
    • E.g. say I create an And implementation that is a composition of If ( "first argument", "second argument", Echo( Boolean("false") ) ) and I call And( Boolean("false"), Boolean("true") )
    • Even though we have run And(), If() and Echo(), there are no nested details of these different executions
    • Is this expected behavior??
  2. Child function calls don't return any metadata, apart from their zObjectKey:
    Screenshot from 2024-06-11 10-18-18.png (223×571 px, 11 KB)
  3. Some child function calls that are part of the parent function call are not being returned in the nested metadata key
    • In the example below, the function call tree is:
* And (
  * Echo (Boolean{"identity":"false"}),
  * If (
     * Boolean{"identity":"true"},
     * Boolean{"identity":"false"},
     * And (Boolean{"identity":"true"}, Boolean{"identity":"true"})))
  • The only function calls reported are the parent-most And and the first direct child, Echo:
    Screenshot from 2024-06-11 10-34-15.png (649×561 px, 65 KB)
  • When inverting the order of the direct children:
* And (
  * If (
     * Boolean{"identity":"true"},
     * Boolean{"identity":"false"},
     * Boolean{"identity": "true"}
  * Echo (Boolean{"identity":"false"}))
  • We also see that only the first child (If) is added into the nestedMetadata list:
    Screenshot from 2024-06-11 10-52-17.png (619×565 px, 61 KB)
  • We also observe that the nested metadata tree stops at the first level, only the first direct child of the parent call seems to appear. See an example of the first child, If, having a child function call Echo:
    Screenshot from 2024-06-11 10-57-27.png (622×572 px, 64 KB)

Change #1036184 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] Add nested metadata to FunctionMetadataDialog component

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

jforrester merged https://gitlab.wikimedia.org/repos/abstract-wiki/wikifunctions/function-orchestrator/-/merge_requests/191

Make ReferenceResolver.dereference return a bare object (not a ZWrapper) and clean up treatment of nested metadata.

Change #1046787 had a related patch set uploaded (by Jforrester; author: Jforrester):

[operations/deployment-charts@master] wikifunctions: Upgrade orchestrator from 2024-06-11-223956 to 2024-06-17-221517

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

Change #1046787 merged by jenkins-bot:

[operations/deployment-charts@master] wikifunctions: Upgrade orchestrator from 2024-06-11-223956 to 2024-06-17-221517

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