Skip to content

[ES|QL Controls] Highlight related panels on click, refactor Related Panels system#264426

Merged
Zacqary merged 80 commits into
elastic:mainfrom
Zacqary:204508-esql-highlight
Jun 16, 2026
Merged

[ES|QL Controls] Highlight related panels on click, refactor Related Panels system#264426
Zacqary merged 80 commits into
elastic:mainfrom
Zacqary:204508-esql-highlight

Conversation

@Zacqary

@Zacqary Zacqary commented Apr 20, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #204508

Refactor

Removes the Related Panels Manager from the dashboard API and replaces this with a relatedPanels$ publishing subject on all panels. All panels now compute which of their siblings they're related to.

  • Filter controls are related to all panels in their same scope (unsectioned, i.e. global, or in the same section)
  • ES|QL controls have the same logic, except they also check to see if panels in their scope consume their variable
  • All panels are related to all filter controls in the same scope
  • ES|QL visualizations are related to ES|QL controls in the same scope that publish a variable they consume

Enhancement

Allows the user to click on ES|QL control labels to highlight all their related panels. Also fixes a bug where giving an ES|QL control a title did not save when saving the dashboard.
Screenshot 2026-04-23 at 10 46 40 PM
Screenshot 2026-04-23 at 10 45 21 PM

And displays a warning on ES|QL controls with no related panels:
Screenshot 2026-04-23 at 10 40 08 PM

Chained ES|QL controls (a control that references the variable of another control) are also supported:
Screenshot 2026-04-23 at 10 45 55 PM

Implementation notes

  • Code is calling this "indicate" related panels because we use "highlight" for the animation that plays when you create a new panel. At this rate, Kibana is projected to run out of verbs by mid-2027 and we will have to invent new words like "gleeglorp" whenever we add a new feature.
  • You can only indicate related panels in Edit mode, not View Mode
  • You can only select one control at a time
  • Dashboards are now CanIndicateRelatedChildren, only ES|QL controls currently publish CanIndicateRelatedSiblings so as not to enable this behavior on filter controls
  • Selecting a control will save this state in the Dashboard Backup service to preserve it on page refresh, but won't save it in the dashboard schema when the user saves the dashboard. It's convenient to preserve the page state for the user's sake but probably not necessary for saving and sharing.

Testing

  1. Add the Kibana Logs Sample Data
  2. Save the following dashboard to an ndjson file and import it as a SavedObject
Click to expand
{"accessControl":{"accessMode":"default","owner":"u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0"},"attributes":{"description":"","kibanaSavedObjectMeta":{"searchSourceJSON":"{\"query\":{\"query\":\"\",\"language\":\"kuery\"}}"},"optionsJSON":"{\"hidePanelTitles\":false,\"hidePanelBorders\":false,\"useMargins\":true,\"autoApplyFilters\":true,\"syncColors\":false,\"syncCursor\":true,\"syncTooltips\":false}","panelsJSON":"[{\"type\":\"esql_control\",\"embeddableConfig\":{\"selected_options\":[\"120.56.165.242\"],\"variable_name\":\"ip\",\"single_select\":true,\"variable_type\":\"values\",\"control_type\":\"VALUES_FROM_QUERY\",\"esql_query\":\"FROM kibana_sample_data_logs | WHERE geo.dest == ?geo_dest | STATS BY ip\",\"title\":\"IP (chained to geo.dest)\"},\"panelIndex\":\"6108de48-1993-4051-8b51-0cd6dca622c5\",\"gridData\":{\"y\":0,\"x\":0,\"w\":12,\"h\":2,\"i\":\"6108de48-1993-4051-8b51-0cd6dca622c5\"}},{\"type\":\"vis\",\"embeddableConfig\":{\"title\":\"\",\"attributes\":{\"title\":\"Metric\",\"references\":[],\"state\":{\"datasourceStates\":{\"textBased\":{\"layers\":{\"64a4cc71-c831-4644-9022-3fc833b8be77\":{\"index\":\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\",\"query\":{\"esql\":\"FROM kibana_sample_data_logs | STATS COUNT(*) | RENAME `COUNT(*)` as `Visits`\"},\"columns\":[{\"columnId\":\"Visits\",\"fieldName\":\"Visits\",\"meta\":{\"type\":\"number\",\"esType\":\"long\"},\"inMetricDimension\":true}],\"timeField\":\"@timestamp\"}},\"indexPatternRefs\":[{\"id\":\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\",\"title\":\"kibana_sample_data_logs\",\"timeField\":\"@timestamp\"}]}},\"filters\":[],\"query\":{\"esql\":\"FROM kibana_sample_data_logs | STATS COUNT(*) | RENAME `COUNT(*)` as `Visits`\"},\"visualization\":{\"layerId\":\"64a4cc71-c831-4644-9022-3fc833b8be77\",\"layerType\":\"data\",\"metricAccessor\":\"Visits\"},\"adHocDataViews\":{\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\":{\"id\":\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\",\"title\":\"kibana_sample_data_logs\",\"timeFieldName\":\"@timestamp\",\"sourceFilters\":[],\"type\":\"esql\",\"fieldFormats\":{},\"runtimeFieldMap\":{},\"allowNoIndex\":false,\"name\":\"kibana_sample_data_logs\",\"allowHidden\":false}}},\"visualizationType\":\"lnsMetric\",\"version\":2}},\"panelIndex\":\"fee866b2-4651-43a4-88a0-744aa44895b9\",\"gridData\":{\"y\":2,\"x\":0,\"w\":12,\"h\":7,\"i\":\"fee866b2-4651-43a4-88a0-744aa44895b9\"}},{\"type\":\"vis\",\"embeddableConfig\":{\"title\":\"\",\"attributes\":{\"title\":\"\",\"references\":[],\"state\":{\"datasourceStates\":{\"textBased\":{\"layers\":{\"44a67c01-79aa-4dec-b3c8-b4be0e4bdfc9\":{\"index\":\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\",\"query\":{\"esql\":\"FROM kibana_sample_data_logs | WHERE geo.dest == ?geo_dest | STATS COUNT(*) | RENAME `COUNT(*)` as `Visits by geo.dest`\"},\"columns\":[{\"columnId\":\"Visits by geo.dest\",\"fieldName\":\"Visits by geo.dest\",\"label\":\"Visits by geo.dest\",\"customLabel\":false,\"meta\":{\"type\":\"number\",\"esType\":\"long\"},\"inMetricDimension\":true}],\"timeField\":\"@timestamp\"}},\"indexPatternRefs\":[{\"id\":\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\",\"title\":\"kibana_sample_data_logs\",\"timeField\":\"@timestamp\"}]}},\"filters\":[],\"query\":{\"esql\":\"FROM kibana_sample_data_logs | WHERE geo.dest == ?geo_dest | STATS COUNT(*) | RENAME `COUNT(*)` as `Visits by geo.dest`\"},\"visualization\":{\"layerId\":\"44a67c01-79aa-4dec-b3c8-b4be0e4bdfc9\",\"layerType\":\"data\",\"metricAccessor\":\"Visits by geo.dest\"},\"adHocDataViews\":{\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\":{\"id\":\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\",\"title\":\"kibana_sample_data_logs\",\"timeFieldName\":\"@timestamp\",\"sourceFilters\":[],\"type\":\"esql\",\"fieldFormats\":{},\"runtimeFieldMap\":{},\"allowNoIndex\":false,\"name\":\"kibana_sample_data_logs\",\"allowHidden\":false,\"managed\":false}},\"needsRefresh\":false},\"visualizationType\":\"lnsMetric\",\"version\":2}},\"panelIndex\":\"8d18ca49-2472-43f3-b1ce-0395e461e309\",\"gridData\":{\"y\":0,\"x\":12,\"w\":12,\"h\":7,\"i\":\"8d18ca49-2472-43f3-b1ce-0395e461e309\"}},{\"type\":\"esql_control\",\"embeddableConfig\":{\"selected_options\":[\"css\"],\"variable_name\":\"extension\",\"single_select\":true,\"variable_type\":\"values\",\"control_type\":\"VALUES_FROM_QUERY\",\"esql_query\":\"FROM kibana_sample_data_logs | WHERE geo.dest == ?geo_dest | STATS BY extension\",\"title\":\"Extension\"},\"panelIndex\":\"88e08770-8623-4b3a-a574-793505c6cf20\",\"gridData\":{\"y\":0,\"x\":24,\"w\":12,\"h\":2,\"i\":\"88e08770-8623-4b3a-a574-793505c6cf20\"}},{\"type\":\"vis\",\"embeddableConfig\":{\"attributes\":{\"title\":\"\",\"references\":[],\"state\":{\"datasourceStates\":{\"textBased\":{\"layers\":{\"bb058e6a-aaeb-4740-89de-6ba02134a152\":{\"index\":\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\",\"query\":{\"esql\":\"FROM kibana_sample_data_logs | WHERE extension == ?extension | STATS COUNT(*) | RENAME `COUNT(*)` as `Visits by extension`\"},\"columns\":[{\"columnId\":\"Visits by extension\",\"fieldName\":\"Visits by extension\",\"label\":\"Visits by extension\",\"customLabel\":false,\"meta\":{\"type\":\"number\",\"esType\":\"long\"},\"inMetricDimension\":true}],\"timeField\":\"@timestamp\"}},\"indexPatternRefs\":[{\"id\":\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\",\"title\":\"kibana_sample_data_logs\",\"timeField\":\"@timestamp\"}]}},\"filters\":[],\"query\":{\"esql\":\"FROM kibana_sample_data_logs | WHERE extension == ?extension | STATS COUNT(*) | RENAME `COUNT(*)` as `Visits by extension`\"},\"visualization\":{\"layerId\":\"bb058e6a-aaeb-4740-89de-6ba02134a152\",\"layerType\":\"data\",\"metricAccessor\":\"Visits by extension\"},\"adHocDataViews\":{\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\":{\"id\":\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\",\"title\":\"kibana_sample_data_logs\",\"timeFieldName\":\"@timestamp\",\"sourceFilters\":[],\"type\":\"esql\",\"fieldFormats\":{},\"runtimeFieldMap\":{},\"allowNoIndex\":false,\"name\":\"kibana_sample_data_logs\",\"allowHidden\":false,\"managed\":false}},\"needsRefresh\":false},\"visualizationType\":\"lnsMetric\",\"version\":2},\"title\":\"\",\"drilldowns\":[]},\"panelIndex\":\"2174ae82-3535-44d9-8c69-2b5aaf280d18\",\"gridData\":{\"y\":2,\"x\":24,\"w\":12,\"h\":7,\"i\":\"2174ae82-3535-44d9-8c69-2b5aaf280d18\"}},{\"type\":\"vis\",\"embeddableConfig\":{\"title\":\"\",\"attributes\":{\"title\":\"Metric\",\"references\":[],\"state\":{\"datasourceStates\":{\"textBased\":{\"layers\":{\"323d8ae0-0a4e-4540-84e2-0d36c8f15b46\":{\"index\":\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\",\"query\":{\"esql\":\"FROM kibana_sample_data_logs | STATS COUNT_DISTINCT(clientip) | RENAME `COUNT_DISTINCT(clientip)` as `Unique Visitors`\"},\"columns\":[{\"columnId\":\"Unique Visitors\",\"fieldName\":\"Unique Visitors\",\"meta\":{\"type\":\"number\",\"esType\":\"long\"},\"inMetricDimension\":true}],\"timeField\":\"@timestamp\"}},\"indexPatternRefs\":[{\"id\":\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\",\"title\":\"kibana_sample_data_logs\",\"timeField\":\"@timestamp\"}]}},\"filters\":[],\"query\":{\"esql\":\"FROM kibana_sample_data_logs | STATS COUNT_DISTINCT(clientip) | RENAME `COUNT_DISTINCT(clientip)` as `Unique Visitors`\"},\"visualization\":{\"layerId\":\"323d8ae0-0a4e-4540-84e2-0d36c8f15b46\",\"layerType\":\"data\",\"metricAccessor\":\"Unique Visitors\",\"palette\":{\"name\":\"custom\",\"type\":\"palette\",\"params\":{\"steps\":3,\"name\":\"custom\",\"reverse\":false,\"rangeType\":\"number\",\"rangeMin\":0,\"rangeMax\":null,\"progression\":\"fixed\",\"stops\":[{\"color\":\"#D23115\",\"stop\":500},{\"color\":\"#FCC400\",\"stop\":1000},{\"color\":\"#68BC00\",\"stop\":1640}],\"colorStops\":[{\"color\":\"#D23115\",\"stop\":0},{\"color\":\"#FCC400\",\"stop\":500},{\"color\":\"#68BC00\",\"stop\":1000}],\"continuity\":\"above\",\"maxSteps\":5}}},\"adHocDataViews\":{\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\":{\"id\":\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\",\"title\":\"kibana_sample_data_logs\",\"timeFieldName\":\"@timestamp\",\"sourceFilters\":[],\"type\":\"esql\",\"fieldFormats\":{},\"runtimeFieldMap\":{},\"allowNoIndex\":false,\"name\":\"kibana_sample_data_logs\",\"allowHidden\":false}}},\"visualizationType\":\"lnsMetric\",\"version\":2}},\"panelIndex\":\"6a8785a6-f4cd-4fc7-a9d3-b66ddb07db5d\",\"gridData\":{\"y\":9,\"x\":0,\"w\":12,\"h\":7,\"i\":\"6a8785a6-f4cd-4fc7-a9d3-b66ddb07db5d\"}},{\"type\":\"vis\",\"embeddableConfig\":{\"title\":\"\",\"attributes\":{\"title\":\"\",\"references\":[],\"state\":{\"datasourceStates\":{\"textBased\":{\"layers\":{\"a37be685-3f6e-4b97-b7dd-37b4e5548c5e\":{\"index\":\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\",\"query\":{\"esql\":\"FROM kibana_sample_data_logs | WHERE geo.dest == ?geo_dest | STATS COUNT_DISTINCT(clientip) | RENAME `COUNT_DISTINCT(clientip)` as `Unique Visitors by geo.dest`\"},\"columns\":[{\"columnId\":\"Unique Visitors by geo.dest\",\"fieldName\":\"Unique Visitors by geo.dest\",\"label\":\"Unique Visitors by geo.dest\",\"customLabel\":false,\"meta\":{\"type\":\"number\",\"esType\":\"long\"},\"inMetricDimension\":true}],\"timeField\":\"@timestamp\"}},\"indexPatternRefs\":[{\"id\":\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\",\"title\":\"kibana_sample_data_logs\",\"timeField\":\"@timestamp\"}]}},\"filters\":[],\"query\":{\"esql\":\"FROM kibana_sample_data_logs | WHERE geo.dest == ?geo_dest | STATS COUNT_DISTINCT(clientip) | RENAME `COUNT_DISTINCT(clientip)` as `Unique Visitors by geo.dest`\"},\"visualization\":{\"layerId\":\"a37be685-3f6e-4b97-b7dd-37b4e5548c5e\",\"layerType\":\"data\",\"metricAccessor\":\"Unique Visitors by geo.dest\",\"palette\":{\"name\":\"custom\",\"type\":\"palette\",\"params\":{\"steps\":3,\"name\":\"custom\",\"reverse\":false,\"rangeType\":\"number\",\"rangeMin\":0,\"rangeMax\":null,\"progression\":\"fixed\",\"stops\":[{\"color\":\"#D23115\",\"stop\":500},{\"color\":\"#FCC400\",\"stop\":1000},{\"color\":\"#68BC00\",\"stop\":1640}],\"colorStops\":[{\"color\":\"#D23115\",\"stop\":0},{\"color\":\"#FCC400\",\"stop\":500},{\"color\":\"#68BC00\",\"stop\":1000}],\"continuity\":\"above\",\"maxSteps\":5}}},\"adHocDataViews\":{\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\":{\"id\":\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\",\"title\":\"kibana_sample_data_logs\",\"timeFieldName\":\"@timestamp\",\"sourceFilters\":[],\"type\":\"esql\",\"fieldFormats\":{},\"runtimeFieldMap\":{},\"allowNoIndex\":false,\"name\":\"kibana_sample_data_logs\",\"allowHidden\":false,\"managed\":false}},\"needsRefresh\":false},\"visualizationType\":\"lnsMetric\",\"version\":2}},\"panelIndex\":\"33c701cd-9e46-4f30-8697-02be563a27c9\",\"gridData\":{\"y\":7,\"x\":12,\"w\":12,\"h\":7,\"i\":\"33c701cd-9e46-4f30-8697-02be563a27c9\"}},{\"type\":\"vis\",\"embeddableConfig\":{\"title\":\"\",\"attributes\":{\"title\":\"\",\"references\":[],\"state\":{\"datasourceStates\":{\"textBased\":{\"layers\":{\"6e9ab6e8-d953-4fb0-a056-39018adb3338\":{\"index\":\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\",\"query\":{\"esql\":\"FROM kibana_sample_data_logs | WHERE extension == ?extension | STATS COUNT_DISTINCT(clientip) | RENAME `COUNT_DISTINCT(clientip)` as `Unique Visitors by extension`\"},\"columns\":[{\"columnId\":\"Unique Visitors by extension\",\"fieldName\":\"Unique Visitors by extension\",\"label\":\"Unique Visitors by extension\",\"customLabel\":false,\"meta\":{\"type\":\"number\",\"esType\":\"long\"},\"inMetricDimension\":true}],\"timeField\":\"@timestamp\"}},\"indexPatternRefs\":[{\"id\":\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\",\"title\":\"kibana_sample_data_logs\",\"timeField\":\"@timestamp\"}]}},\"filters\":[],\"query\":{\"esql\":\"FROM kibana_sample_data_logs | WHERE extension == ?extension | STATS COUNT_DISTINCT(clientip) | RENAME `COUNT_DISTINCT(clientip)` as `Unique Visitors by extension`\"},\"visualization\":{\"layerId\":\"6e9ab6e8-d953-4fb0-a056-39018adb3338\",\"layerType\":\"data\",\"metricAccessor\":\"Unique Visitors by extension\",\"palette\":{\"name\":\"custom\",\"type\":\"palette\",\"params\":{\"steps\":3,\"name\":\"custom\",\"reverse\":false,\"rangeType\":\"number\",\"rangeMin\":0,\"rangeMax\":null,\"progression\":\"fixed\",\"stops\":[{\"color\":\"#D23115\",\"stop\":500},{\"color\":\"#FCC400\",\"stop\":1000},{\"color\":\"#68BC00\",\"stop\":1640}],\"colorStops\":[{\"color\":\"#D23115\",\"stop\":0},{\"color\":\"#FCC400\",\"stop\":500},{\"color\":\"#68BC00\",\"stop\":1000}],\"continuity\":\"above\",\"maxSteps\":5}}},\"adHocDataViews\":{\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\":{\"id\":\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\",\"title\":\"kibana_sample_data_logs\",\"timeFieldName\":\"@timestamp\",\"sourceFilters\":[],\"type\":\"esql\",\"fieldFormats\":{},\"runtimeFieldMap\":{},\"allowNoIndex\":false,\"name\":\"kibana_sample_data_logs\",\"allowHidden\":false,\"managed\":false}},\"needsRefresh\":false},\"visualizationType\":\"lnsMetric\",\"version\":2}},\"panelIndex\":\"0436b504-23f2-43fb-b985-cbc59a78db20\",\"gridData\":{\"y\":9,\"x\":24,\"w\":12,\"h\":7,\"i\":\"0436b504-23f2-43fb-b985-cbc59a78db20\"}}]","pinned_panels":{"panels":{"406812b2-db25-4cb1-be57-ff38eccab340":{"config":{"control_type":"VALUES_FROM_QUERY","esql_query":"FROM kibana_sample_data_logs | STATS BY geo.dest","selected_options":["AL"],"single_select":true,"title":"Geo Dest","variable_name":"geo_dest","variable_type":"values"},"grow":false,"order":0,"type":"esql_control","width":"medium"}}},"timeRestore":false,"title":"ES|QL Test"},"coreMigrationVersion":"8.8.0","created_at":"2026-04-23T18:12:33.957Z","created_by":"u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0","id":"4ed63a99-f7e5-40bd-af9a-bd3971ec6bc4","managed":false,"references":[],"type":"dashboard","typeMigrationVersion":"10.3.0","updated_at":"2026-04-23T20:37:46.876Z","updated_by":"u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0","version":"WzIyLDFd"}
{"excludedObjects":[],"excludedObjectsCount":0,"exportedCount":1,"missingRefCount":0,"missingReferences":[]}

Checklist

@Zacqary Zacqary force-pushed the 204508-esql-highlight branch from b7cc28a to 087ca94 Compare April 20, 2026 14:11
@Zacqary Zacqary added release_note:enhancement Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas t// loe:medium Medium Level of Effort backport:version Backport to applied version labels v9.5.0 impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. Feature:Dashboard Dashboard related features labels Apr 20, 2026
Comment thread src/platform/packages/shared/controls/controls-schemas/src/types.ts Outdated
@Zacqary Zacqary force-pushed the 204508-esql-highlight branch from 087ca94 to 4021c2d Compare April 20, 2026 14:36
@Zacqary Zacqary force-pushed the 204508-esql-highlight branch from 4021c2d to d3b43ad Compare April 20, 2026 14:42
@Zacqary Zacqary force-pushed the 204508-esql-highlight branch 2 times, most recently from 8b4343b to ea0fda0 Compare April 20, 2026 15:01
@Zacqary Zacqary force-pushed the 204508-esql-highlight branch 9 times, most recently from 5270bb4 to 5aee652 Compare April 21, 2026 10:04
@Zacqary Zacqary marked this pull request as ready for review April 21, 2026 10:08
@Zacqary Zacqary requested review from a team as code owners April 21, 2026 10:09
@elasticmachine

Copy link
Copy Markdown
Contributor

Pinging @elastic/kibana-presentation (Team:Presentation)

@Heenawter Heenawter left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just bumping the comments that still need resolution before I give a green check 🙇

Comment thread src/platform/plugins/shared/dashboard/public/services/dashboard_backup_service.ts Outdated
@Zacqary Zacqary requested a review from Heenawter June 16, 2026 15:27

@Heenawter Heenawter left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left one nit about a typo, but otherwise, LGTM! Thank you so much for your work on this - I know it has been a rollercoaster. But overall I think we landed on a really clean implementation that will be much easier to maintain in the future ❤️ And it works so smoothly with sections + panel edits now - I am so excited! Our users are going to absolutely love this! 🚀 🚀 🚀

…r_control/get_timeslider_control_factory.tsx

Co-authored-by: Hannah Mudge <Heenawter@users.noreply.github.com>
@Zacqary Zacqary enabled auto-merge (squash) June 16, 2026 16:46
@kibanamachine

Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
agentBuilder 2040 2047 +7
agentBuilderDashboards 600 607 +7
aiops 805 812 +7
alertingVTwo 1349 1356 +7
apm 2279 2290 +11
canvas 1319 1324 +5
cases 2124 2131 +7
cloudSecurityPosture 831 838 +7
console 392 399 +7
controls 435 448 +13
dashboard 1139 1149 +10
dashboardMarkdown 129 134 +5
data 644 651 +7
datasetQuality 1130 1137 +7
dataVisualizer 940 947 +7
discover 2134 2145 +11
discoverEnhanced 111 116 +5
embeddable 268 273 +5
embeddableAlertsTable 474 479 +5
esql 1077 1084 +7
esqlDataGrid 497 504 +7
eventAnnotationListing 893 900 +7
fleet 2222 2229 +7
imageEmbeddable 169 174 +5
infra 1921 1932 +11
inputControlVis 135 140 +5
lens 1818 1825 +7
links 156 161 +5
lists 477 484 +7
logsShared 490 497 +7
maps 1382 1393 +11
ml 4400 4407 +7
observability 1828 1839 +11
observabilityAIAssistantApp 857 864 +7
observabilityLogsExplorer 311 318 +7
osquery 820 827 +7
queryActivity 314 321 +7
reporting 261 266 +5
searchPlayground 637 644 +7
securitySolution 9595 9606 +11
slo 1393 1404 +11
stackAlerts 238 245 +7
streamsApp 2033 2040 +7
synthetics 1346 1351 +5
transform 955 962 +7
triggersActionsUi 1871 1882 +11
unifiedDocViewer 993 1000 +7
urlDrilldown 158 163 +5
visTypeTimeseries 528 533 +5
visTypeVega 1840 1847 +7
visualizations 782 789 +7
workflowsManagement 1986 1993 +7
total +381

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
apm 2.9MB 2.9MB +4.3KB
controls 528.0KB 537.0KB +8.9KB
dashboard 1.1MB 1.1MB +3.1KB
discover 1.9MB 1.9MB +4.3KB
esql 936.3KB 936.3KB +10.0B
infra 1.5MB 1.5MB +4.1KB
lens 2.1MB 2.1MB -53.0B
maps 3.2MB 3.2MB +4.1KB
observability 2.1MB 2.1MB +4.1KB
securitySolution 12.1MB 12.1MB +4.1KB
slo 1.2MB 1.2MB +4.2KB
triggersActionsUi 2.6MB 2.6MB +4.1KB
total +45.1KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
controls 9.2KB 9.2KB -1.0B
discover 28.9KB 28.9KB +1.0B
lens 88.4KB 88.3KB -100.0B
maps 32.2KB 32.2KB -4.0B
slo 36.9KB 36.9KB -4.0B
total -108.0B
Unknown metric groups

ESLint disabled line counts

id before after diff
controls 4 5 +1

Total ESLint disabled count

id before after diff
controls 4 5 +1

History

@Zacqary Zacqary merged commit bf83835 into elastic:main Jun 16, 2026
31 checks passed
@kibanamachine kibanamachine added backport:skip This PR does not require backporting and removed backport:version Backport to applied version labels labels Jun 16, 2026
VladimirFilonov pushed a commit to VladimirFilonov/kibana that referenced this pull request Jun 17, 2026
…Panels system (elastic#264426)

## Summary

Closes elastic#204508

## Refactor

Removes the Related Panels Manager from the dashboard API and replaces
this with a `relatedPanels$` publishing subject on all panels. All
panels now compute which of their siblings they're related to.

- Filter controls are related to all panels in their same scope
(unsectioned, i.e. global, or in the same section)
- ES|QL controls have the same logic, except they also check to see if
panels in their scope consume their variable
- All panels are related to all filter controls in the same scope
- ES|QL visualizations are related to ES|QL controls in the same scope
that publish a variable they consume

## Enhancement

Allows the user to click on ES|QL control labels to highlight all their
related panels. Also fixes a bug where giving an ES|QL control a `title`
did not save when saving the dashboard.
<img width="1674" height="827" alt="Screenshot 2026-04-23 at 10 46
40 PM"
src="https://github.com/user-attachments/assets/7a995aab-ee35-4f4c-a910-38ac6fddc152"
/>
<img width="1670" height="756" alt="Screenshot 2026-04-23 at 10 45
21 PM"
src="https://github.com/user-attachments/assets/a0afae22-5bf8-466b-96fe-52c6fc8503dd"
/>


And displays a warning on ES|QL controls with no related panels:
<img width="1673" height="839" alt="Screenshot 2026-04-23 at 10 40
08 PM"
src="https://github.com/user-attachments/assets/8991fb8d-4170-4537-80c8-17415b5cea4e"
/>

Chained ES|QL controls (a control that references the variable of
another control) are also supported:
<img width="1664" height="812" alt="Screenshot 2026-04-23 at 10 45
55 PM"
src="https://github.com/user-attachments/assets/a3e65a3d-c88c-4791-bbf6-0267588412d0"
/>



### Implementation notes

- Code is calling this "indicate" related panels because we use
"highlight" for the animation that plays when you create a new panel. At
this rate, Kibana is projected to run out of verbs by mid-2027 and we
will have to invent new words like "gleeglorp" whenever we add a new
feature.
- You can only indicate related panels in Edit mode, not View Mode
- You can only select one control at a time
- Dashboards are now `CanIndicateRelatedChildren`, only ES|QL controls
currently publish `CanIndicateRelatedSiblings` so as not to enable this
behavior on filter controls
- Selecting a control will save this state in the Dashboard Backup
service to preserve it on page refresh, but won't save it in the
dashboard schema when the user saves the dashboard. It's convenient to
preserve the page state for the user's sake but probably not necessary
for saving and sharing.

### Testing

1. Add the Kibana Logs Sample Data
2. Save the following dashboard to an ndjson file and import it as a
SavedObject
<details>
<summary>Click to expand</summary>

```
{"accessControl":{"accessMode":"default","owner":"u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0"},"attributes":{"description":"","kibanaSavedObjectMeta":{"searchSourceJSON":"{\"query\":{\"query\":\"\",\"language\":\"kuery\"}}"},"optionsJSON":"{\"hidePanelTitles\":false,\"hidePanelBorders\":false,\"useMargins\":true,\"autoApplyFilters\":true,\"syncColors\":false,\"syncCursor\":true,\"syncTooltips\":false}","panelsJSON":"[{\"type\":\"esql_control\",\"embeddableConfig\":{\"selected_options\":[\"120.56.165.242\"],\"variable_name\":\"ip\",\"single_select\":true,\"variable_type\":\"values\",\"control_type\":\"VALUES_FROM_QUERY\",\"esql_query\":\"FROM kibana_sample_data_logs | WHERE geo.dest == ?geo_dest | STATS BY ip\",\"title\":\"IP (chained to geo.dest)\"},\"panelIndex\":\"6108de48-1993-4051-8b51-0cd6dca622c5\",\"gridData\":{\"y\":0,\"x\":0,\"w\":12,\"h\":2,\"i\":\"6108de48-1993-4051-8b51-0cd6dca622c5\"}},{\"type\":\"vis\",\"embeddableConfig\":{\"title\":\"\",\"attributes\":{\"title\":\"Metric\",\"references\":[],\"state\":{\"datasourceStates\":{\"textBased\":{\"layers\":{\"64a4cc71-c831-4644-9022-3fc833b8be77\":{\"index\":\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\",\"query\":{\"esql\":\"FROM kibana_sample_data_logs | STATS COUNT(*) | RENAME `COUNT(*)` as `Visits`\"},\"columns\":[{\"columnId\":\"Visits\",\"fieldName\":\"Visits\",\"meta\":{\"type\":\"number\",\"esType\":\"long\"},\"inMetricDimension\":true}],\"timeField\":\"@timestamp\"}},\"indexPatternRefs\":[{\"id\":\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\",\"title\":\"kibana_sample_data_logs\",\"timeField\":\"@timestamp\"}]}},\"filters\":[],\"query\":{\"esql\":\"FROM kibana_sample_data_logs | STATS COUNT(*) | RENAME `COUNT(*)` as `Visits`\"},\"visualization\":{\"layerId\":\"64a4cc71-c831-4644-9022-3fc833b8be77\",\"layerType\":\"data\",\"metricAccessor\":\"Visits\"},\"adHocDataViews\":{\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\":{\"id\":\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\",\"title\":\"kibana_sample_data_logs\",\"timeFieldName\":\"@timestamp\",\"sourceFilters\":[],\"type\":\"esql\",\"fieldFormats\":{},\"runtimeFieldMap\":{},\"allowNoIndex\":false,\"name\":\"kibana_sample_data_logs\",\"allowHidden\":false}}},\"visualizationType\":\"lnsMetric\",\"version\":2}},\"panelIndex\":\"fee866b2-4651-43a4-88a0-744aa44895b9\",\"gridData\":{\"y\":2,\"x\":0,\"w\":12,\"h\":7,\"i\":\"fee866b2-4651-43a4-88a0-744aa44895b9\"}},{\"type\":\"vis\",\"embeddableConfig\":{\"title\":\"\",\"attributes\":{\"title\":\"\",\"references\":[],\"state\":{\"datasourceStates\":{\"textBased\":{\"layers\":{\"44a67c01-79aa-4dec-b3c8-b4be0e4bdfc9\":{\"index\":\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\",\"query\":{\"esql\":\"FROM kibana_sample_data_logs | WHERE geo.dest == ?geo_dest | STATS COUNT(*) | RENAME `COUNT(*)` as `Visits by geo.dest`\"},\"columns\":[{\"columnId\":\"Visits by geo.dest\",\"fieldName\":\"Visits by geo.dest\",\"label\":\"Visits by geo.dest\",\"customLabel\":false,\"meta\":{\"type\":\"number\",\"esType\":\"long\"},\"inMetricDimension\":true}],\"timeField\":\"@timestamp\"}},\"indexPatternRefs\":[{\"id\":\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\",\"title\":\"kibana_sample_data_logs\",\"timeField\":\"@timestamp\"}]}},\"filters\":[],\"query\":{\"esql\":\"FROM kibana_sample_data_logs | WHERE geo.dest == ?geo_dest | STATS COUNT(*) | RENAME `COUNT(*)` as `Visits by geo.dest`\"},\"visualization\":{\"layerId\":\"44a67c01-79aa-4dec-b3c8-b4be0e4bdfc9\",\"layerType\":\"data\",\"metricAccessor\":\"Visits by geo.dest\"},\"adHocDataViews\":{\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\":{\"id\":\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\",\"title\":\"kibana_sample_data_logs\",\"timeFieldName\":\"@timestamp\",\"sourceFilters\":[],\"type\":\"esql\",\"fieldFormats\":{},\"runtimeFieldMap\":{},\"allowNoIndex\":false,\"name\":\"kibana_sample_data_logs\",\"allowHidden\":false,\"managed\":false}},\"needsRefresh\":false},\"visualizationType\":\"lnsMetric\",\"version\":2}},\"panelIndex\":\"8d18ca49-2472-43f3-b1ce-0395e461e309\",\"gridData\":{\"y\":0,\"x\":12,\"w\":12,\"h\":7,\"i\":\"8d18ca49-2472-43f3-b1ce-0395e461e309\"}},{\"type\":\"esql_control\",\"embeddableConfig\":{\"selected_options\":[\"css\"],\"variable_name\":\"extension\",\"single_select\":true,\"variable_type\":\"values\",\"control_type\":\"VALUES_FROM_QUERY\",\"esql_query\":\"FROM kibana_sample_data_logs | WHERE geo.dest == ?geo_dest | STATS BY extension\",\"title\":\"Extension\"},\"panelIndex\":\"88e08770-8623-4b3a-a574-793505c6cf20\",\"gridData\":{\"y\":0,\"x\":24,\"w\":12,\"h\":2,\"i\":\"88e08770-8623-4b3a-a574-793505c6cf20\"}},{\"type\":\"vis\",\"embeddableConfig\":{\"attributes\":{\"title\":\"\",\"references\":[],\"state\":{\"datasourceStates\":{\"textBased\":{\"layers\":{\"bb058e6a-aaeb-4740-89de-6ba02134a152\":{\"index\":\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\",\"query\":{\"esql\":\"FROM kibana_sample_data_logs | WHERE extension == ?extension | STATS COUNT(*) | RENAME `COUNT(*)` as `Visits by extension`\"},\"columns\":[{\"columnId\":\"Visits by extension\",\"fieldName\":\"Visits by extension\",\"label\":\"Visits by extension\",\"customLabel\":false,\"meta\":{\"type\":\"number\",\"esType\":\"long\"},\"inMetricDimension\":true}],\"timeField\":\"@timestamp\"}},\"indexPatternRefs\":[{\"id\":\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\",\"title\":\"kibana_sample_data_logs\",\"timeField\":\"@timestamp\"}]}},\"filters\":[],\"query\":{\"esql\":\"FROM kibana_sample_data_logs | WHERE extension == ?extension | STATS COUNT(*) | RENAME `COUNT(*)` as `Visits by extension`\"},\"visualization\":{\"layerId\":\"bb058e6a-aaeb-4740-89de-6ba02134a152\",\"layerType\":\"data\",\"metricAccessor\":\"Visits by extension\"},\"adHocDataViews\":{\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\":{\"id\":\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\",\"title\":\"kibana_sample_data_logs\",\"timeFieldName\":\"@timestamp\",\"sourceFilters\":[],\"type\":\"esql\",\"fieldFormats\":{},\"runtimeFieldMap\":{},\"allowNoIndex\":false,\"name\":\"kibana_sample_data_logs\",\"allowHidden\":false,\"managed\":false}},\"needsRefresh\":false},\"visualizationType\":\"lnsMetric\",\"version\":2},\"title\":\"\",\"drilldowns\":[]},\"panelIndex\":\"2174ae82-3535-44d9-8c69-2b5aaf280d18\",\"gridData\":{\"y\":2,\"x\":24,\"w\":12,\"h\":7,\"i\":\"2174ae82-3535-44d9-8c69-2b5aaf280d18\"}},{\"type\":\"vis\",\"embeddableConfig\":{\"title\":\"\",\"attributes\":{\"title\":\"Metric\",\"references\":[],\"state\":{\"datasourceStates\":{\"textBased\":{\"layers\":{\"323d8ae0-0a4e-4540-84e2-0d36c8f15b46\":{\"index\":\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\",\"query\":{\"esql\":\"FROM kibana_sample_data_logs | STATS COUNT_DISTINCT(clientip) | RENAME `COUNT_DISTINCT(clientip)` as `Unique Visitors`\"},\"columns\":[{\"columnId\":\"Unique Visitors\",\"fieldName\":\"Unique Visitors\",\"meta\":{\"type\":\"number\",\"esType\":\"long\"},\"inMetricDimension\":true}],\"timeField\":\"@timestamp\"}},\"indexPatternRefs\":[{\"id\":\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\",\"title\":\"kibana_sample_data_logs\",\"timeField\":\"@timestamp\"}]}},\"filters\":[],\"query\":{\"esql\":\"FROM kibana_sample_data_logs | STATS COUNT_DISTINCT(clientip) | RENAME `COUNT_DISTINCT(clientip)` as `Unique Visitors`\"},\"visualization\":{\"layerId\":\"323d8ae0-0a4e-4540-84e2-0d36c8f15b46\",\"layerType\":\"data\",\"metricAccessor\":\"Unique Visitors\",\"palette\":{\"name\":\"custom\",\"type\":\"palette\",\"params\":{\"steps\":3,\"name\":\"custom\",\"reverse\":false,\"rangeType\":\"number\",\"rangeMin\":0,\"rangeMax\":null,\"progression\":\"fixed\",\"stops\":[{\"color\":\"#D23115\",\"stop\":500},{\"color\":\"#FCC400\",\"stop\":1000},{\"color\":\"#68BC00\",\"stop\":1640}],\"colorStops\":[{\"color\":\"#D23115\",\"stop\":0},{\"color\":\"#FCC400\",\"stop\":500},{\"color\":\"#68BC00\",\"stop\":1000}],\"continuity\":\"above\",\"maxSteps\":5}}},\"adHocDataViews\":{\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\":{\"id\":\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\",\"title\":\"kibana_sample_data_logs\",\"timeFieldName\":\"@timestamp\",\"sourceFilters\":[],\"type\":\"esql\",\"fieldFormats\":{},\"runtimeFieldMap\":{},\"allowNoIndex\":false,\"name\":\"kibana_sample_data_logs\",\"allowHidden\":false}}},\"visualizationType\":\"lnsMetric\",\"version\":2}},\"panelIndex\":\"6a8785a6-f4cd-4fc7-a9d3-b66ddb07db5d\",\"gridData\":{\"y\":9,\"x\":0,\"w\":12,\"h\":7,\"i\":\"6a8785a6-f4cd-4fc7-a9d3-b66ddb07db5d\"}},{\"type\":\"vis\",\"embeddableConfig\":{\"title\":\"\",\"attributes\":{\"title\":\"\",\"references\":[],\"state\":{\"datasourceStates\":{\"textBased\":{\"layers\":{\"a37be685-3f6e-4b97-b7dd-37b4e5548c5e\":{\"index\":\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\",\"query\":{\"esql\":\"FROM kibana_sample_data_logs | WHERE geo.dest == ?geo_dest | STATS COUNT_DISTINCT(clientip) | RENAME `COUNT_DISTINCT(clientip)` as `Unique Visitors by geo.dest`\"},\"columns\":[{\"columnId\":\"Unique Visitors by geo.dest\",\"fieldName\":\"Unique Visitors by geo.dest\",\"label\":\"Unique Visitors by geo.dest\",\"customLabel\":false,\"meta\":{\"type\":\"number\",\"esType\":\"long\"},\"inMetricDimension\":true}],\"timeField\":\"@timestamp\"}},\"indexPatternRefs\":[{\"id\":\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\",\"title\":\"kibana_sample_data_logs\",\"timeField\":\"@timestamp\"}]}},\"filters\":[],\"query\":{\"esql\":\"FROM kibana_sample_data_logs | WHERE geo.dest == ?geo_dest | STATS COUNT_DISTINCT(clientip) | RENAME `COUNT_DISTINCT(clientip)` as `Unique Visitors by geo.dest`\"},\"visualization\":{\"layerId\":\"a37be685-3f6e-4b97-b7dd-37b4e5548c5e\",\"layerType\":\"data\",\"metricAccessor\":\"Unique Visitors by geo.dest\",\"palette\":{\"name\":\"custom\",\"type\":\"palette\",\"params\":{\"steps\":3,\"name\":\"custom\",\"reverse\":false,\"rangeType\":\"number\",\"rangeMin\":0,\"rangeMax\":null,\"progression\":\"fixed\",\"stops\":[{\"color\":\"#D23115\",\"stop\":500},{\"color\":\"#FCC400\",\"stop\":1000},{\"color\":\"#68BC00\",\"stop\":1640}],\"colorStops\":[{\"color\":\"#D23115\",\"stop\":0},{\"color\":\"#FCC400\",\"stop\":500},{\"color\":\"#68BC00\",\"stop\":1000}],\"continuity\":\"above\",\"maxSteps\":5}}},\"adHocDataViews\":{\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\":{\"id\":\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\",\"title\":\"kibana_sample_data_logs\",\"timeFieldName\":\"@timestamp\",\"sourceFilters\":[],\"type\":\"esql\",\"fieldFormats\":{},\"runtimeFieldMap\":{},\"allowNoIndex\":false,\"name\":\"kibana_sample_data_logs\",\"allowHidden\":false,\"managed\":false}},\"needsRefresh\":false},\"visualizationType\":\"lnsMetric\",\"version\":2}},\"panelIndex\":\"33c701cd-9e46-4f30-8697-02be563a27c9\",\"gridData\":{\"y\":7,\"x\":12,\"w\":12,\"h\":7,\"i\":\"33c701cd-9e46-4f30-8697-02be563a27c9\"}},{\"type\":\"vis\",\"embeddableConfig\":{\"title\":\"\",\"attributes\":{\"title\":\"\",\"references\":[],\"state\":{\"datasourceStates\":{\"textBased\":{\"layers\":{\"6e9ab6e8-d953-4fb0-a056-39018adb3338\":{\"index\":\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\",\"query\":{\"esql\":\"FROM kibana_sample_data_logs | WHERE extension == ?extension | STATS COUNT_DISTINCT(clientip) | RENAME `COUNT_DISTINCT(clientip)` as `Unique Visitors by extension`\"},\"columns\":[{\"columnId\":\"Unique Visitors by extension\",\"fieldName\":\"Unique Visitors by extension\",\"label\":\"Unique Visitors by extension\",\"customLabel\":false,\"meta\":{\"type\":\"number\",\"esType\":\"long\"},\"inMetricDimension\":true}],\"timeField\":\"@timestamp\"}},\"indexPatternRefs\":[{\"id\":\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\",\"title\":\"kibana_sample_data_logs\",\"timeField\":\"@timestamp\"}]}},\"filters\":[],\"query\":{\"esql\":\"FROM kibana_sample_data_logs | WHERE extension == ?extension | STATS COUNT_DISTINCT(clientip) | RENAME `COUNT_DISTINCT(clientip)` as `Unique Visitors by extension`\"},\"visualization\":{\"layerId\":\"6e9ab6e8-d953-4fb0-a056-39018adb3338\",\"layerType\":\"data\",\"metricAccessor\":\"Unique Visitors by extension\",\"palette\":{\"name\":\"custom\",\"type\":\"palette\",\"params\":{\"steps\":3,\"name\":\"custom\",\"reverse\":false,\"rangeType\":\"number\",\"rangeMin\":0,\"rangeMax\":null,\"progression\":\"fixed\",\"stops\":[{\"color\":\"#D23115\",\"stop\":500},{\"color\":\"#FCC400\",\"stop\":1000},{\"color\":\"#68BC00\",\"stop\":1640}],\"colorStops\":[{\"color\":\"#D23115\",\"stop\":0},{\"color\":\"#FCC400\",\"stop\":500},{\"color\":\"#68BC00\",\"stop\":1000}],\"continuity\":\"above\",\"maxSteps\":5}}},\"adHocDataViews\":{\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\":{\"id\":\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\",\"title\":\"kibana_sample_data_logs\",\"timeFieldName\":\"@timestamp\",\"sourceFilters\":[],\"type\":\"esql\",\"fieldFormats\":{},\"runtimeFieldMap\":{},\"allowNoIndex\":false,\"name\":\"kibana_sample_data_logs\",\"allowHidden\":false,\"managed\":false}},\"needsRefresh\":false},\"visualizationType\":\"lnsMetric\",\"version\":2}},\"panelIndex\":\"0436b504-23f2-43fb-b985-cbc59a78db20\",\"gridData\":{\"y\":9,\"x\":24,\"w\":12,\"h\":7,\"i\":\"0436b504-23f2-43fb-b985-cbc59a78db20\"}}]","pinned_panels":{"panels":{"406812b2-db25-4cb1-be57-ff38eccab340":{"config":{"control_type":"VALUES_FROM_QUERY","esql_query":"FROM kibana_sample_data_logs | STATS BY geo.dest","selected_options":["AL"],"single_select":true,"title":"Geo Dest","variable_name":"geo_dest","variable_type":"values"},"grow":false,"order":0,"type":"esql_control","width":"medium"}}},"timeRestore":false,"title":"ES|QL Test"},"coreMigrationVersion":"8.8.0","created_at":"2026-04-23T18:12:33.957Z","created_by":"u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0","id":"4ed63a99-f7e5-40bd-af9a-bd3971ec6bc4","managed":false,"references":[],"type":"dashboard","typeMigrationVersion":"10.3.0","updated_at":"2026-04-23T20:37:46.876Z","updated_by":"u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0","version":"WzIyLDFd"}
{"excludedObjects":[],"excludedObjectsCount":0,"exportedCount":1,"missingRefCount":0,"missingReferences":[]}
```

</details>


### Checklist
- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Hannah Mudge <Heenawter@users.noreply.github.com>
Co-authored-by: Florent LB <florent.leborgne@elastic.co>
Co-authored-by: Stratou <efstratia.kalafateli@elastic.co>
Co-authored-by: heenawter <hannah.wright@elastic.co>
Zacqary added a commit that referenced this pull request Jun 17, 2026
…dit mode or flyout (#273760)

## Summary

Quick UX fix followup to #264426.
User reported confusion when:

1. Editing a panel
2. Clicking an ES|QL control to indicate related panels
3. Closing the edit window and seeing all the related panels remain
highlighted

This is because the `relatedPanelsIndicatorId` is set independently of
opening or closing an edit flyout. This PR makes sure to clear the
indicator ID when entering or leaving an edit flyout.
Heenawter added a commit that referenced this pull request Jun 22, 2026
Closes #268695

## Summary

This PR fixes the suggestions when editing field variable controls for
both Dashboard and Discover.

For Dashboard, it does so by determining the related query **on
runtime** when the editor is opened, making use of the new
`relatedPanels$` system that was introduced in
#264426. It loops through all the
children that are related, and it returns the query of the **first one**
that uses it. For Discover, we provide the ES|QL query via the parent,
and determine whether it is related from that. If the parent's and/or
related child's ES|QL query references the given variable, the field
suggestions will be populated.

**Before**


https://github.com/user-attachments/assets/e6043228-2ea6-463f-9761-13e772e9a149

**After**


https://github.com/user-attachments/assets/566f3720-abe2-4400-ba3e-3813606874de


### Checklist

- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [x] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.
flash1293 pushed a commit to flash1293/kibana that referenced this pull request Jun 23, 2026
…Panels system (elastic#264426)

## Summary

Closes elastic#204508

## Refactor

Removes the Related Panels Manager from the dashboard API and replaces
this with a `relatedPanels$` publishing subject on all panels. All
panels now compute which of their siblings they're related to.

- Filter controls are related to all panels in their same scope
(unsectioned, i.e. global, or in the same section)
- ES|QL controls have the same logic, except they also check to see if
panels in their scope consume their variable
- All panels are related to all filter controls in the same scope
- ES|QL visualizations are related to ES|QL controls in the same scope
that publish a variable they consume

## Enhancement

Allows the user to click on ES|QL control labels to highlight all their
related panels. Also fixes a bug where giving an ES|QL control a `title`
did not save when saving the dashboard.
<img width="1674" height="827" alt="Screenshot 2026-04-23 at 10 46
40 PM"
src="https://github.com/user-attachments/assets/7a995aab-ee35-4f4c-a910-38ac6fddc152"
/>
<img width="1670" height="756" alt="Screenshot 2026-04-23 at 10 45
21 PM"
src="https://github.com/user-attachments/assets/a0afae22-5bf8-466b-96fe-52c6fc8503dd"
/>


And displays a warning on ES|QL controls with no related panels:
<img width="1673" height="839" alt="Screenshot 2026-04-23 at 10 40
08 PM"
src="https://github.com/user-attachments/assets/8991fb8d-4170-4537-80c8-17415b5cea4e"
/>

Chained ES|QL controls (a control that references the variable of
another control) are also supported:
<img width="1664" height="812" alt="Screenshot 2026-04-23 at 10 45
55 PM"
src="https://github.com/user-attachments/assets/a3e65a3d-c88c-4791-bbf6-0267588412d0"
/>



### Implementation notes

- Code is calling this "indicate" related panels because we use
"highlight" for the animation that plays when you create a new panel. At
this rate, Kibana is projected to run out of verbs by mid-2027 and we
will have to invent new words like "gleeglorp" whenever we add a new
feature.
- You can only indicate related panels in Edit mode, not View Mode
- You can only select one control at a time
- Dashboards are now `CanIndicateRelatedChildren`, only ES|QL controls
currently publish `CanIndicateRelatedSiblings` so as not to enable this
behavior on filter controls
- Selecting a control will save this state in the Dashboard Backup
service to preserve it on page refresh, but won't save it in the
dashboard schema when the user saves the dashboard. It's convenient to
preserve the page state for the user's sake but probably not necessary
for saving and sharing.

### Testing

1. Add the Kibana Logs Sample Data
2. Save the following dashboard to an ndjson file and import it as a
SavedObject
<details>
<summary>Click to expand</summary>

```
{"accessControl":{"accessMode":"default","owner":"u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0"},"attributes":{"description":"","kibanaSavedObjectMeta":{"searchSourceJSON":"{\"query\":{\"query\":\"\",\"language\":\"kuery\"}}"},"optionsJSON":"{\"hidePanelTitles\":false,\"hidePanelBorders\":false,\"useMargins\":true,\"autoApplyFilters\":true,\"syncColors\":false,\"syncCursor\":true,\"syncTooltips\":false}","panelsJSON":"[{\"type\":\"esql_control\",\"embeddableConfig\":{\"selected_options\":[\"120.56.165.242\"],\"variable_name\":\"ip\",\"single_select\":true,\"variable_type\":\"values\",\"control_type\":\"VALUES_FROM_QUERY\",\"esql_query\":\"FROM kibana_sample_data_logs | WHERE geo.dest == ?geo_dest | STATS BY ip\",\"title\":\"IP (chained to geo.dest)\"},\"panelIndex\":\"6108de48-1993-4051-8b51-0cd6dca622c5\",\"gridData\":{\"y\":0,\"x\":0,\"w\":12,\"h\":2,\"i\":\"6108de48-1993-4051-8b51-0cd6dca622c5\"}},{\"type\":\"vis\",\"embeddableConfig\":{\"title\":\"\",\"attributes\":{\"title\":\"Metric\",\"references\":[],\"state\":{\"datasourceStates\":{\"textBased\":{\"layers\":{\"64a4cc71-c831-4644-9022-3fc833b8be77\":{\"index\":\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\",\"query\":{\"esql\":\"FROM kibana_sample_data_logs | STATS COUNT(*) | RENAME `COUNT(*)` as `Visits`\"},\"columns\":[{\"columnId\":\"Visits\",\"fieldName\":\"Visits\",\"meta\":{\"type\":\"number\",\"esType\":\"long\"},\"inMetricDimension\":true}],\"timeField\":\"@timestamp\"}},\"indexPatternRefs\":[{\"id\":\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\",\"title\":\"kibana_sample_data_logs\",\"timeField\":\"@timestamp\"}]}},\"filters\":[],\"query\":{\"esql\":\"FROM kibana_sample_data_logs | STATS COUNT(*) | RENAME `COUNT(*)` as `Visits`\"},\"visualization\":{\"layerId\":\"64a4cc71-c831-4644-9022-3fc833b8be77\",\"layerType\":\"data\",\"metricAccessor\":\"Visits\"},\"adHocDataViews\":{\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\":{\"id\":\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\",\"title\":\"kibana_sample_data_logs\",\"timeFieldName\":\"@timestamp\",\"sourceFilters\":[],\"type\":\"esql\",\"fieldFormats\":{},\"runtimeFieldMap\":{},\"allowNoIndex\":false,\"name\":\"kibana_sample_data_logs\",\"allowHidden\":false}}},\"visualizationType\":\"lnsMetric\",\"version\":2}},\"panelIndex\":\"fee866b2-4651-43a4-88a0-744aa44895b9\",\"gridData\":{\"y\":2,\"x\":0,\"w\":12,\"h\":7,\"i\":\"fee866b2-4651-43a4-88a0-744aa44895b9\"}},{\"type\":\"vis\",\"embeddableConfig\":{\"title\":\"\",\"attributes\":{\"title\":\"\",\"references\":[],\"state\":{\"datasourceStates\":{\"textBased\":{\"layers\":{\"44a67c01-79aa-4dec-b3c8-b4be0e4bdfc9\":{\"index\":\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\",\"query\":{\"esql\":\"FROM kibana_sample_data_logs | WHERE geo.dest == ?geo_dest | STATS COUNT(*) | RENAME `COUNT(*)` as `Visits by geo.dest`\"},\"columns\":[{\"columnId\":\"Visits by geo.dest\",\"fieldName\":\"Visits by geo.dest\",\"label\":\"Visits by geo.dest\",\"customLabel\":false,\"meta\":{\"type\":\"number\",\"esType\":\"long\"},\"inMetricDimension\":true}],\"timeField\":\"@timestamp\"}},\"indexPatternRefs\":[{\"id\":\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\",\"title\":\"kibana_sample_data_logs\",\"timeField\":\"@timestamp\"}]}},\"filters\":[],\"query\":{\"esql\":\"FROM kibana_sample_data_logs | WHERE geo.dest == ?geo_dest | STATS COUNT(*) | RENAME `COUNT(*)` as `Visits by geo.dest`\"},\"visualization\":{\"layerId\":\"44a67c01-79aa-4dec-b3c8-b4be0e4bdfc9\",\"layerType\":\"data\",\"metricAccessor\":\"Visits by geo.dest\"},\"adHocDataViews\":{\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\":{\"id\":\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\",\"title\":\"kibana_sample_data_logs\",\"timeFieldName\":\"@timestamp\",\"sourceFilters\":[],\"type\":\"esql\",\"fieldFormats\":{},\"runtimeFieldMap\":{},\"allowNoIndex\":false,\"name\":\"kibana_sample_data_logs\",\"allowHidden\":false,\"managed\":false}},\"needsRefresh\":false},\"visualizationType\":\"lnsMetric\",\"version\":2}},\"panelIndex\":\"8d18ca49-2472-43f3-b1ce-0395e461e309\",\"gridData\":{\"y\":0,\"x\":12,\"w\":12,\"h\":7,\"i\":\"8d18ca49-2472-43f3-b1ce-0395e461e309\"}},{\"type\":\"esql_control\",\"embeddableConfig\":{\"selected_options\":[\"css\"],\"variable_name\":\"extension\",\"single_select\":true,\"variable_type\":\"values\",\"control_type\":\"VALUES_FROM_QUERY\",\"esql_query\":\"FROM kibana_sample_data_logs | WHERE geo.dest == ?geo_dest | STATS BY extension\",\"title\":\"Extension\"},\"panelIndex\":\"88e08770-8623-4b3a-a574-793505c6cf20\",\"gridData\":{\"y\":0,\"x\":24,\"w\":12,\"h\":2,\"i\":\"88e08770-8623-4b3a-a574-793505c6cf20\"}},{\"type\":\"vis\",\"embeddableConfig\":{\"attributes\":{\"title\":\"\",\"references\":[],\"state\":{\"datasourceStates\":{\"textBased\":{\"layers\":{\"bb058e6a-aaeb-4740-89de-6ba02134a152\":{\"index\":\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\",\"query\":{\"esql\":\"FROM kibana_sample_data_logs | WHERE extension == ?extension | STATS COUNT(*) | RENAME `COUNT(*)` as `Visits by extension`\"},\"columns\":[{\"columnId\":\"Visits by extension\",\"fieldName\":\"Visits by extension\",\"label\":\"Visits by extension\",\"customLabel\":false,\"meta\":{\"type\":\"number\",\"esType\":\"long\"},\"inMetricDimension\":true}],\"timeField\":\"@timestamp\"}},\"indexPatternRefs\":[{\"id\":\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\",\"title\":\"kibana_sample_data_logs\",\"timeField\":\"@timestamp\"}]}},\"filters\":[],\"query\":{\"esql\":\"FROM kibana_sample_data_logs | WHERE extension == ?extension | STATS COUNT(*) | RENAME `COUNT(*)` as `Visits by extension`\"},\"visualization\":{\"layerId\":\"bb058e6a-aaeb-4740-89de-6ba02134a152\",\"layerType\":\"data\",\"metricAccessor\":\"Visits by extension\"},\"adHocDataViews\":{\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\":{\"id\":\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\",\"title\":\"kibana_sample_data_logs\",\"timeFieldName\":\"@timestamp\",\"sourceFilters\":[],\"type\":\"esql\",\"fieldFormats\":{},\"runtimeFieldMap\":{},\"allowNoIndex\":false,\"name\":\"kibana_sample_data_logs\",\"allowHidden\":false,\"managed\":false}},\"needsRefresh\":false},\"visualizationType\":\"lnsMetric\",\"version\":2},\"title\":\"\",\"drilldowns\":[]},\"panelIndex\":\"2174ae82-3535-44d9-8c69-2b5aaf280d18\",\"gridData\":{\"y\":2,\"x\":24,\"w\":12,\"h\":7,\"i\":\"2174ae82-3535-44d9-8c69-2b5aaf280d18\"}},{\"type\":\"vis\",\"embeddableConfig\":{\"title\":\"\",\"attributes\":{\"title\":\"Metric\",\"references\":[],\"state\":{\"datasourceStates\":{\"textBased\":{\"layers\":{\"323d8ae0-0a4e-4540-84e2-0d36c8f15b46\":{\"index\":\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\",\"query\":{\"esql\":\"FROM kibana_sample_data_logs | STATS COUNT_DISTINCT(clientip) | RENAME `COUNT_DISTINCT(clientip)` as `Unique Visitors`\"},\"columns\":[{\"columnId\":\"Unique Visitors\",\"fieldName\":\"Unique Visitors\",\"meta\":{\"type\":\"number\",\"esType\":\"long\"},\"inMetricDimension\":true}],\"timeField\":\"@timestamp\"}},\"indexPatternRefs\":[{\"id\":\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\",\"title\":\"kibana_sample_data_logs\",\"timeField\":\"@timestamp\"}]}},\"filters\":[],\"query\":{\"esql\":\"FROM kibana_sample_data_logs | STATS COUNT_DISTINCT(clientip) | RENAME `COUNT_DISTINCT(clientip)` as `Unique Visitors`\"},\"visualization\":{\"layerId\":\"323d8ae0-0a4e-4540-84e2-0d36c8f15b46\",\"layerType\":\"data\",\"metricAccessor\":\"Unique Visitors\",\"palette\":{\"name\":\"custom\",\"type\":\"palette\",\"params\":{\"steps\":3,\"name\":\"custom\",\"reverse\":false,\"rangeType\":\"number\",\"rangeMin\":0,\"rangeMax\":null,\"progression\":\"fixed\",\"stops\":[{\"color\":\"#D23115\",\"stop\":500},{\"color\":\"#FCC400\",\"stop\":1000},{\"color\":\"#68BC00\",\"stop\":1640}],\"colorStops\":[{\"color\":\"#D23115\",\"stop\":0},{\"color\":\"#FCC400\",\"stop\":500},{\"color\":\"#68BC00\",\"stop\":1000}],\"continuity\":\"above\",\"maxSteps\":5}}},\"adHocDataViews\":{\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\":{\"id\":\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\",\"title\":\"kibana_sample_data_logs\",\"timeFieldName\":\"@timestamp\",\"sourceFilters\":[],\"type\":\"esql\",\"fieldFormats\":{},\"runtimeFieldMap\":{},\"allowNoIndex\":false,\"name\":\"kibana_sample_data_logs\",\"allowHidden\":false}}},\"visualizationType\":\"lnsMetric\",\"version\":2}},\"panelIndex\":\"6a8785a6-f4cd-4fc7-a9d3-b66ddb07db5d\",\"gridData\":{\"y\":9,\"x\":0,\"w\":12,\"h\":7,\"i\":\"6a8785a6-f4cd-4fc7-a9d3-b66ddb07db5d\"}},{\"type\":\"vis\",\"embeddableConfig\":{\"title\":\"\",\"attributes\":{\"title\":\"\",\"references\":[],\"state\":{\"datasourceStates\":{\"textBased\":{\"layers\":{\"a37be685-3f6e-4b97-b7dd-37b4e5548c5e\":{\"index\":\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\",\"query\":{\"esql\":\"FROM kibana_sample_data_logs | WHERE geo.dest == ?geo_dest | STATS COUNT_DISTINCT(clientip) | RENAME `COUNT_DISTINCT(clientip)` as `Unique Visitors by geo.dest`\"},\"columns\":[{\"columnId\":\"Unique Visitors by geo.dest\",\"fieldName\":\"Unique Visitors by geo.dest\",\"label\":\"Unique Visitors by geo.dest\",\"customLabel\":false,\"meta\":{\"type\":\"number\",\"esType\":\"long\"},\"inMetricDimension\":true}],\"timeField\":\"@timestamp\"}},\"indexPatternRefs\":[{\"id\":\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\",\"title\":\"kibana_sample_data_logs\",\"timeField\":\"@timestamp\"}]}},\"filters\":[],\"query\":{\"esql\":\"FROM kibana_sample_data_logs | WHERE geo.dest == ?geo_dest | STATS COUNT_DISTINCT(clientip) | RENAME `COUNT_DISTINCT(clientip)` as `Unique Visitors by geo.dest`\"},\"visualization\":{\"layerId\":\"a37be685-3f6e-4b97-b7dd-37b4e5548c5e\",\"layerType\":\"data\",\"metricAccessor\":\"Unique Visitors by geo.dest\",\"palette\":{\"name\":\"custom\",\"type\":\"palette\",\"params\":{\"steps\":3,\"name\":\"custom\",\"reverse\":false,\"rangeType\":\"number\",\"rangeMin\":0,\"rangeMax\":null,\"progression\":\"fixed\",\"stops\":[{\"color\":\"#D23115\",\"stop\":500},{\"color\":\"#FCC400\",\"stop\":1000},{\"color\":\"#68BC00\",\"stop\":1640}],\"colorStops\":[{\"color\":\"#D23115\",\"stop\":0},{\"color\":\"#FCC400\",\"stop\":500},{\"color\":\"#68BC00\",\"stop\":1000}],\"continuity\":\"above\",\"maxSteps\":5}}},\"adHocDataViews\":{\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\":{\"id\":\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\",\"title\":\"kibana_sample_data_logs\",\"timeFieldName\":\"@timestamp\",\"sourceFilters\":[],\"type\":\"esql\",\"fieldFormats\":{},\"runtimeFieldMap\":{},\"allowNoIndex\":false,\"name\":\"kibana_sample_data_logs\",\"allowHidden\":false,\"managed\":false}},\"needsRefresh\":false},\"visualizationType\":\"lnsMetric\",\"version\":2}},\"panelIndex\":\"33c701cd-9e46-4f30-8697-02be563a27c9\",\"gridData\":{\"y\":7,\"x\":12,\"w\":12,\"h\":7,\"i\":\"33c701cd-9e46-4f30-8697-02be563a27c9\"}},{\"type\":\"vis\",\"embeddableConfig\":{\"title\":\"\",\"attributes\":{\"title\":\"\",\"references\":[],\"state\":{\"datasourceStates\":{\"textBased\":{\"layers\":{\"6e9ab6e8-d953-4fb0-a056-39018adb3338\":{\"index\":\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\",\"query\":{\"esql\":\"FROM kibana_sample_data_logs | WHERE extension == ?extension | STATS COUNT_DISTINCT(clientip) | RENAME `COUNT_DISTINCT(clientip)` as `Unique Visitors by extension`\"},\"columns\":[{\"columnId\":\"Unique Visitors by extension\",\"fieldName\":\"Unique Visitors by extension\",\"label\":\"Unique Visitors by extension\",\"customLabel\":false,\"meta\":{\"type\":\"number\",\"esType\":\"long\"},\"inMetricDimension\":true}],\"timeField\":\"@timestamp\"}},\"indexPatternRefs\":[{\"id\":\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\",\"title\":\"kibana_sample_data_logs\",\"timeField\":\"@timestamp\"}]}},\"filters\":[],\"query\":{\"esql\":\"FROM kibana_sample_data_logs | WHERE extension == ?extension | STATS COUNT_DISTINCT(clientip) | RENAME `COUNT_DISTINCT(clientip)` as `Unique Visitors by extension`\"},\"visualization\":{\"layerId\":\"6e9ab6e8-d953-4fb0-a056-39018adb3338\",\"layerType\":\"data\",\"metricAccessor\":\"Unique Visitors by extension\",\"palette\":{\"name\":\"custom\",\"type\":\"palette\",\"params\":{\"steps\":3,\"name\":\"custom\",\"reverse\":false,\"rangeType\":\"number\",\"rangeMin\":0,\"rangeMax\":null,\"progression\":\"fixed\",\"stops\":[{\"color\":\"#D23115\",\"stop\":500},{\"color\":\"#FCC400\",\"stop\":1000},{\"color\":\"#68BC00\",\"stop\":1640}],\"colorStops\":[{\"color\":\"#D23115\",\"stop\":0},{\"color\":\"#FCC400\",\"stop\":500},{\"color\":\"#68BC00\",\"stop\":1000}],\"continuity\":\"above\",\"maxSteps\":5}}},\"adHocDataViews\":{\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\":{\"id\":\"e3465e67bdeced2befff9f9dca7ecf9c48504cad68a10efd881f4c7dd5ade28a\",\"title\":\"kibana_sample_data_logs\",\"timeFieldName\":\"@timestamp\",\"sourceFilters\":[],\"type\":\"esql\",\"fieldFormats\":{},\"runtimeFieldMap\":{},\"allowNoIndex\":false,\"name\":\"kibana_sample_data_logs\",\"allowHidden\":false,\"managed\":false}},\"needsRefresh\":false},\"visualizationType\":\"lnsMetric\",\"version\":2}},\"panelIndex\":\"0436b504-23f2-43fb-b985-cbc59a78db20\",\"gridData\":{\"y\":9,\"x\":24,\"w\":12,\"h\":7,\"i\":\"0436b504-23f2-43fb-b985-cbc59a78db20\"}}]","pinned_panels":{"panels":{"406812b2-db25-4cb1-be57-ff38eccab340":{"config":{"control_type":"VALUES_FROM_QUERY","esql_query":"FROM kibana_sample_data_logs | STATS BY geo.dest","selected_options":["AL"],"single_select":true,"title":"Geo Dest","variable_name":"geo_dest","variable_type":"values"},"grow":false,"order":0,"type":"esql_control","width":"medium"}}},"timeRestore":false,"title":"ES|QL Test"},"coreMigrationVersion":"8.8.0","created_at":"2026-04-23T18:12:33.957Z","created_by":"u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0","id":"4ed63a99-f7e5-40bd-af9a-bd3971ec6bc4","managed":false,"references":[],"type":"dashboard","typeMigrationVersion":"10.3.0","updated_at":"2026-04-23T20:37:46.876Z","updated_by":"u_mGBROF_q5bmFCATbLXAcCwKa0k8JvONAwSruelyKA5E_0","version":"WzIyLDFd"}
{"excludedObjects":[],"excludedObjectsCount":0,"exportedCount":1,"missingRefCount":0,"missingReferences":[]}
```

</details>


### Checklist
- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Hannah Mudge <Heenawter@users.noreply.github.com>
Co-authored-by: Florent LB <florent.leborgne@elastic.co>
Co-authored-by: Stratou <efstratia.kalafateli@elastic.co>
Co-authored-by: heenawter <hannah.wright@elastic.co>
flash1293 pushed a commit to flash1293/kibana that referenced this pull request Jun 23, 2026
…dit mode or flyout (elastic#273760)

## Summary

Quick UX fix followup to elastic#264426.
User reported confusion when:

1. Editing a panel
2. Clicking an ES|QL control to indicate related panels
3. Closing the edit window and seeing all the related panels remain
highlighted

This is because the `relatedPanelsIndicatorId` is set independently of
opening or closing an edit flyout. This PR makes sure to clear the
indicator ID when entering or leaving an edit flyout.
flash1293 pushed a commit to flash1293/kibana that referenced this pull request Jun 23, 2026
Closes elastic#268695

## Summary

This PR fixes the suggestions when editing field variable controls for
both Dashboard and Discover.

For Dashboard, it does so by determining the related query **on
runtime** when the editor is opened, making use of the new
`relatedPanels$` system that was introduced in
elastic#264426. It loops through all the
children that are related, and it returns the query of the **first one**
that uses it. For Discover, we provide the ES|QL query via the parent,
and determine whether it is related from that. If the parent's and/or
related child's ES|QL query references the given variable, the field
suggestions will be populated.

**Before**


https://github.com/user-attachments/assets/e6043228-2ea6-463f-9761-13e772e9a149

**After**


https://github.com/user-attachments/assets/566f3720-abe2-4400-ba3e-3813606874de


### Checklist

- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [x] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting Feature:Dashboard Dashboard related features Feature:Drilldowns Embeddable panel Drilldowns Feature:Embedding Embedding content via iFrame impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. loe:medium Medium Level of Effort release_note:enhancement reviewer:skip-ai Skip automatic AI reviews Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas t// v9.5.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ES|QL Controls] Highlight panels

10 participants