codeant-ai-for-open-source[bot] commented on PR #38890:
URL: https://github.com/apache/superset/pull/38890#issuecomment-4137723786

   ## **Sequence Diagram**
   
   This PR changes how the MCP add-chart tool updates dashboard layouts so 
that, when tabs are already under the root layout node, new charts are inserted 
inside the first tab and the grid container is not added alongside tabs, 
keeping charts visible in tabbed dashboards.
   
   ```mermaid
   sequenceDiagram
       participant Client
       participant MCPTool as MCP dashboard tool
       participant Store as Dashboard storage
       participant Layout as Layout helper
       participant Cmd as Dashboard update command
   
       Client->>MCPTool: Add chart to existing dashboard
       MCPTool->>Store: Load dashboard and chart by id
       MCPTool->>Layout: Find tab target and ensure layout structure
   
       alt Tabs are under ROOT_ID
           Layout->>Layout: Add new row under first tab\nand do not add grid to 
root
       else No tabs under ROOT_ID
           Layout->>Layout: Add new row under grid\nand attach grid to root if 
needed
       end
   
       MCPTool->>Cmd: Save updated layout and chart list
       Cmd-->>MCPTool: Return updated dashboard
       MCPTool-->>Client: Return dashboard info and chart position
   ```
   
   ---
   *Generated by [CodeAnt AI](https://codeant.ai)*
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to