Skip to content

Conversation

@stratoula
Copy link
Contributor

@stratoula stratoula commented Nov 13, 2025

Summary

Closes #238473

Adds support of chaining variable controls (ES|QL). Specifically:

  • If there are already variable controls in a dashboard, when you create a new variable control you see these suggestions at the ES|QL editor
image

For the above I had to make a small change in the editor. Now the editor can suggest variables if they are being provided but can only suggest the Create control only if the supportsControl flag is enabled. For the above example we want the variables to be suggested but not the create control

  • If the users create a 2nd control that references another ES|QL one then we have chaining controls. This means that when a user is selecting a value at the first, the query at the second should rerun. If the selected value is not at the new list then we mark it as incompatible. I used the existing invalid suggestions mechanism, just changed the label.
image

Checklist

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The change here is:

  • if the supportsControl flag is enabled we display the "Create control" suggestion
  • if variables exist we suggest them regardless of the supportsControl flag

}) => {
const popoverId = useMemo(() => htmlIdGenerator()(), []);
const { componentApi, displaySettings } = useOptionsListContext();
const { componentApi, displaySettings, customStrings } = useOptionsListContext();
Copy link
Contributor Author

@stratoula stratoula Nov 20, 2025

Choose a reason for hiding this comment

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

The invalid selection label is not making sense here as the value is valid (the chart works) but is not part of the updated list.

In order to introduce a new custom label I add a customStrings option in the context. It can be a property too. Let me know what you prefer.

@stratoula stratoula added v9.3.0 Feature:ES|QL ES|QL related features in Kibana release_note:feature Makes this part of the condensed release notes Team:ESQL ES|QL related features in Kibana t// backport:skip This PR does not require backporting labels Nov 21, 2025
@stratoula stratoula marked this pull request as ready for review November 21, 2025 15:07
@stratoula stratoula requested review from a team as code owners November 21, 2025 15:07
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-esql (Team:ESQL)

@Heenawter
Copy link
Contributor

Just adding a comment here for transparency. As discussed offline, we will be waiting until the Controls Anywhere feature lands before merging this work, since the conflicts here will be pretty nasty and that work takes priority 🙇

@stratoula
Copy link
Contributor Author

@Heenawter as long as you take care of the conflicts cc @teresaalvarezsoler

@stratoula
Copy link
Contributor Author

stratoula commented Nov 24, 2025

Actually I am going to move the code on the ES|QL packages in another PR #243934 as it can be merged sooner and then you can take care of the rest.

For this reason I am going to close this PR and move the issue to the presentation team.

@stratoula stratoula closed this Nov 24, 2025
stratoula added a commit that referenced this pull request Nov 26, 2025
…3934)

## Summary

Part of #238473

This PR is a necessary step before chaining controls. In the chaining
controls we want to get variables suggestions but we do not want to get
the "Create control" suggestion.

This PR is accomplishing this with some small changes on how we treat
the supportsControl prop in the editor.


Note: I decided to move this away from the
#242909 as the presentation team
is working on a big refactoring so they will take care of the chaining
controls.

### Checklist

- [ ] [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
eokoneyo pushed a commit to eokoneyo/kibana that referenced this pull request Dec 2, 2025
…stic#243934)

## Summary

Part of elastic#238473

This PR is a necessary step before chaining controls. In the chaining
controls we want to get variables suggestions but we do not want to get
the "Create control" suggestion.

This PR is accomplishing this with some small changes on how we treat
the supportsControl prop in the editor.


Note: I decided to move this away from the
elastic#242909 as the presentation team
is working on a big refactoring so they will take care of the chaining
controls.

### Checklist

- [ ] [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
@stratoula stratoula reopened this Dec 2, 2025
@stratoula stratoula marked this pull request as draft December 2, 2025 16:36
@stratoula
Copy link
Contributor Author

We decided to move forward with this PR. I am moving it to draft to check that it still works ok and I will give it for review tmr!

@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #34 / Alerting bulkDisable should bulk disable and untrack

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
controls 407 408 +1

Async chunks

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

id before after diff
controls 492.5KB 494.6KB +2.1KB
esql 674.8KB 674.9KB +64.0B
total +2.2KB

Page load bundle

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

id before after diff
controls 10.9KB 10.9KB +53.0B

History

@stratoula stratoula marked this pull request as ready for review December 3, 2025 07:46
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:ES|QL ES|QL related features in Kibana release_note:feature Makes this part of the condensed release notes Team:ESQL ES|QL related features in Kibana t// v9.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Variable controls] Allow chaining for variable controls

3 participants