aminghadersohi opened a new pull request, #38409:
URL: https://github.com/apache/superset/pull/38409

   ### SUMMARY
   
   When adding charts to a dashboard that uses tabs via the 
`add_chart_to_existing_dashboard` MCP tool, the `target_tab` parameter was 
accepted without error but completely ignored. Charts were always placed in the 
first tab or under `GRID_ID` at the root level, where they become invisible 
ghost entries — registered in the dashboard metadata but never rendered in the 
UI.
   
   **Root cause:** `_find_tab_insert_target()` always returned the first `TAB` 
child and the `request.target_tab` value was never passed to it.
   
   **Fix:** `_find_tab_insert_target()` now accepts an optional `target_tab` 
parameter and resolves it by matching against the tab display name 
(`meta.text`) or the raw component ID. When no match is found it falls back to 
the first tab to preserve backward compatibility.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   N/A — backend logic change, no UI modifications.
   
   ### TESTING INSTRUCTIONS
   
   1. Create a dashboard with multiple tabs (e.g., "Activity Metrics", 
"Customers")
   2. Call `add_chart_to_existing_dashboard` with `target_tab` set to the 
second tab's name
   3. Verify the chart appears inside the specified tab (not the first tab, and 
not invisible under GRID_ID)
   4. Call without `target_tab` — chart should still land in the first tab 
(backward compat)
   
   ### ADDITIONAL INFORMATION
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API


-- 
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