[ES|QL] [Controls] Fix field variable suggestions#273844
Conversation
|
Pinging @elastic/kibana-presentation (Team:Presentation) |
davismcphee
left a comment
There was a problem hiding this comment.
Code-only review, Data Discovery changes LGTM 👍 Not sure if there was anything specific I should've tested, but looks like just a new query prop being passed now.
|
Thanks @Heenawter 🙌 |
Sorry @davismcphee! Should have included testing instructions + a video for Discover in the PR description 🙈 In summary, by providing the query to the control group renderer, we can properly derive which field suggestions to show. Before Screen.Recording.2026-06-22.at.8.39.52.AM.movAfter Screen.Recording.2026-06-22.at.8.43.01.AM.mov |
Zacqary
left a comment
There was a problem hiding this comment.
Approving to unblock, I think we could make this code a bit more functional though
Zacqary
left a comment
There was a problem hiding this comment.
Approving to unblock, just one nit to clean up the function further
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Async chunks
History
cc @Heenawter |
|
Starting backport for target branches: 9.4 |
💔 All backports failed
Manual backportTo create the backport manually run: Questions ?Please refer to the Backport tool documentation |
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.
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
Screen.Recording.2026-06-19.at.2.16.42.PM.mov
After
Screen.Recording.2026-06-19.at.2.17.39.PM.mov
Checklist
release_note:*label is applied per the guidelinesbackport:*labels.