Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node is not rendered if visual metadata has undefined x and y values #2330

Closed
Mearman opened this issue Jun 27, 2024 · 1 comment · Fixed by #2407
Closed

Node is not rendered if visual metadata has undefined x and y values #2330

Mearman opened this issue Jun 27, 2024 · 1 comment · Fixed by #2407
Assignees

Comments

@Mearman
Copy link
Collaborator

Mearman commented Jun 27, 2024

The following TS

export default await base
  .input({
    $metadata: {
      title: "Input",
      visual: {
        // x: 0,
        // y: 0,
        collapsed: true,
      },
    },
  }).to(base.output())
  .serialize({ title: "Foo" });

produces this JSON

{
  "title": "Foo",
  "edges": [
    {
      "from": "input-50",
      "to": "output-51",
      "out": "*",
      "in": ""
    }
  ],
  "nodes": [
    {
      "id": "input-50",
      "type": "input",
      "configuration": {},
      "metadata": {
        "title": "Input",
        "visual": {
          "collapsed": true
        }
      }
    },
    {
      "id": "output-51",
      "type": "output",
      "configuration": {}
    }
  ]
}

which is rendered like:
CleanShot 2024-06-27 at 11 24 48
which when copied out of the editor yields:

{
  "title": "Foo",
  "metadata": {
    "comments": []
  },
  "edges": [
    {
      "from": "input-50",
      "to": "output-51",
      "out": "*",
      "in": ""
    }
  ],
  "nodes": [
    {
      "id": "input-50",
      "type": "input",
      "configuration": {},
      "metadata": {
        "title": "Input",
        "visual": {
          "x": null,
          "y": null,
          "collapsed": true
        }
      }
    },
    {
      "id": "output-51",
      "type": "output",
      "configuration": {},
      "metadata": {
        "visual": {
          "x": 60,
          "y": 0,
          "collapsed": false
        }
      }
    }
  ]
}

Which is then rendered without the Input node in the GUI.

So, there is probably an issue with the loading of the board, as the serialisation looks fine. But also the bullish values could be handled by BB Web

@Mearman Mearman changed the title Node is not rendered if visual metadata does not have x and y Jun 27, 2024
@paullewis
Copy link
Contributor

This was a fun one to track down!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants