Skip to content

[ES|QL] [Controls] Fix field variable suggestions#273844

Merged
Heenawter merged 15 commits into
elastic:mainfrom
Heenawter:fix-esql-field-suggestions_2026-06-17
Jun 22, 2026
Merged

[ES|QL] [Controls] Fix field variable suggestions#273844
Heenawter merged 15 commits into
elastic:mainfrom
Heenawter:fix-esql-field-suggestions_2026-06-17

Conversation

@Heenawter

@Heenawter Heenawter commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

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

  • The PR description includes the appropriate Release Notes section, and the correct release_note:* label is applied per the guidelines
  • Review the backport guidelines and apply applicable backport:* labels.

@Heenawter Heenawter self-assigned this Jun 17, 2026
@Heenawter Heenawter added regression release_note:fix Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas t// loe:small Small Level of Effort loe:medium Medium Level of Effort impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. backport:version Backport to applied version labels v9.5.0 v9.4.3 labels Jun 17, 2026
@Heenawter Heenawter changed the title [ES|QL] [Controls] Fix field name suggestions [ES|QL] [Controls] Fix field + function variable suggestions Jun 19, 2026
@Heenawter Heenawter changed the title [ES|QL] [Controls] Fix field + function variable suggestions [ES|QL] [Controls] Fix field variable suggestions Jun 19, 2026
@Heenawter Heenawter added v9.4.4 and removed v9.4.3 labels Jun 20, 2026
@Heenawter Heenawter marked this pull request as ready for review June 20, 2026 01:14
@Heenawter Heenawter requested review from a team as code owners June 20, 2026 01:14
@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

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

@davismcphee davismcphee 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.

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.

@Heenawter Heenawter requested a review from stratoula June 20, 2026 02:49
@stratoula

Copy link
Copy Markdown
Contributor

Thanks @Heenawter 🙌

@Heenawter

Heenawter commented Jun 22, 2026

Copy link
Copy Markdown
Contributor Author

Not sure if there was anything specific I should've tested, but looks like just a new query prop being passed now.

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

After

Screen.Recording.2026-06-22.at.8.43.01.AM.mov

@Heenawter Heenawter removed the request for review from stratoula June 22, 2026 15:30

@Zacqary Zacqary 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.

Approving to unblock, I think we could make this code a bit more functional though

@Zacqary Zacqary 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.

Approving to unblock, just one nit to clean up the function further

@Heenawter Heenawter enabled auto-merge (squash) June 22, 2026 20:35
@kibanamachine

Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Scout Lane #11 - stateful-classic / default / local-stateful-classic - UptimeIntegrationDeprecation - returns true when non-managed synthetics policies exist

Metrics [docs]

Async chunks

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

id before after diff
controls 537.2KB 537.5KB +347.0B
discover 2.0MB 2.0MB +8.0B
total +355.0B

History

cc @Heenawter

@Heenawter Heenawter merged commit ec9c2f2 into elastic:main Jun 22, 2026
39 checks passed
@kibanamachine

Copy link
Copy Markdown
Contributor

Starting backport for target branches: 9.4

https://github.com/elastic/kibana/actions/runs/27984260565

@kibanamachine

Copy link
Copy Markdown
Contributor

💔 All backports failed

Status Branch Result
9.4 Backport failed because of merge conflicts

Manual backport

To create the backport manually run:

node scripts/backport --pr 273844

Questions ?

Please refer to the Backport tool documentation

@Heenawter Heenawter added backport:skip This PR does not require backporting and removed backport:version Backport to applied version labels v9.4.4 labels Jun 22, 2026
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 impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. loe:medium Medium Level of Effort loe:small Small Level of Effort regression release_note:fix 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.

[Controls] Related suggestions broken for ES|QL field controls

5 participants