fix(mcp): honor target_tab parameter when adding charts to tabbed dashboards#38372
fix(mcp): honor target_tab parameter when adding charts to tabbed dashboards#38372aminghadersohi wants to merge 1 commit intoapache:masterfrom
Conversation
…hboards The target_tab parameter on add_chart_to_existing_dashboard was accepted but silently ignored, causing charts to always land in the first tab (or under GRID_ID where they become invisible). _find_tab_insert_target now resolves target_tab by display name or component ID before falling back to the first tab.
Code Review Agent Run #1ddbaaActionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #38372 +/- ##
==========================================
+ Coverage 64.30% 65.08% +0.78%
==========================================
Files 1811 2484 +673
Lines 71557 124131 +52574
Branches 22810 28845 +6035
==========================================
+ Hits 46015 80792 +34777
- Misses 25542 41923 +16381
- Partials 0 1416 +1416
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Reopening with a clean branch name. |
SUMMARY
When adding charts to a dashboard that uses tabs via the
add_chart_to_existing_dashboardMCP tool, thetarget_tabparameter was accepted without error but completely ignored. Charts were always placed in the first tab or underGRID_IDat 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 firstTABchild and therequest.target_tabvalue was never passed to it.Fix:
_find_tab_insert_target()now accepts an optionaltarget_tabparameter 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
add_chart_to_existing_dashboardwithtarget_tabset to the second tab's nametarget_tab— chart should still land in the first tab (backward compat)ADDITIONAL INFORMATION