Option to provide the nodePath in addNewComponentToLayout

Created on 28 August 2025, about 1 month ago

Overview

When adding components using the page builder agent, the response sent to the frontend is in the following format format

{
    "status": true,
    "operations": [
        {
            "operation": "ADD",
            "components": [
                {
                    "id": "sdc.starshot_demo.starshot-columns",
                    "nodePath": [
                        1,
                        0
                    ],
                    "fieldValues": {
                        "cols": "two",
                        "gap": "medium",
                        "alignment": "none"
                    }
                },
                {
                    "id": "sdc.starshot_demo.starshot-button",
                    "nodePath": [
                        1,
                        0,
                        0,
                        0
                    ],
                    "fieldValues": {
                        "text": "Read more",
                        "url": "https:\/\/example.com\/read-more-1",
                        "display": "primary"
                    }
                },
                {
                    "id": "sdc.starshot_demo.starshot-button",
                    "nodePath": [
                        1,
                        0,
                        1,
                        0
                    ],
                    "fieldValues": {
                        "text": "Read more",
                        "url": "https:\/\/example.com\/read-more-2",
                        "display": "primary"
                    }
                }
            ]
        }
    ],
}

The nodePath value was calculated for each component to be added, and then passed to addNewComponentToLayout to place it in the required position (e.g in a specific region, above or below another component, or inside a specific slot).

But now, after 📌 Formalize an API for programmatically updating prop values Active got merged, it is no longer possible to pass the nodePath value to the function and therefore the component placement is broken

Proposed resolution

User interface changes

🐛 Bug report
Status

Active

Version

1.0

Component

AI

Created by

🇮🇳India Akhil Babu Chengannur

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024