Skip to content

[PoC] lens esql editor#199632

Closed
ppisljar wants to merge 21 commits intoelastic:mainfrom
ppisljar:poc/lens3
Closed

[PoC] lens esql editor#199632
ppisljar wants to merge 21 commits intoelastic:mainfrom
ppisljar:poc/lens3

Conversation

@ppisljar
Copy link
Copy Markdown
Contributor

Summary

PoC of how editing esql in lens could look like:

  • supports single and multiple esql layers
  • supports for "normal" layers along esql layers
  • supports converting "normal" layers to esql layers
  • everything else works as expected (reference lines, annotations, formatting, apperance editing ....)

Things that are not implemented in this PoC:

  • some lens operations are still not supported in esql, so those cant be converted
  • lens formulas are not converted at the moment (but most likely could be)
  • drag and drop is disabled at the moment (but most likely could be implemented)

@elasticmachine
Copy link
Copy Markdown
Contributor

🤖 Jobs for this PR can be triggered through checkboxes. 🚧

ℹ️ To trigger the CI, please tick the checkbox below 👇

  • Click to trigger kibana-pull-request for this PR!
  • Click to trigger kibana-deploy-project-from-pr for this PR!

@ppisljar ppisljar closed this Sep 29, 2025
@walterra walterra mentioned this pull request Dec 9, 2025
10 tasks
walterra added a commit that referenced this pull request Jan 29, 2026
## Summary

Follow up to #246209. Implements
elastic/kibana-team#2391. Also implements part
of elastic/kibana-team#2179.

This applies the work done in PoCs #199632 and #245716 to the new UI
flow with the conversion modal added in #246209.

This PR wires up the ES|QL conversion modal to actually perform the
datasource conversion. Related to that, it also cleans up the inline
editing flyout code by removing redundant props.

- `handleConvertToEsql` callback to switch flyout from formBased to
textBased mode
- Updates visualization state to remap column IDs (xAccessor, accessors,
splitAccessor) to ES|QL field names
- Reduces prop drilling of `datasourceId` and `canEditTextBasedQuery`,
adds `hideTextBasedEditor` to Redux state for Discover integration.

Note: The full feature is still behind a dev-mode flag, it's not enabled
in production. The scope of this PR is to enable the full UI flow of
DSL->ES|QL conversion and enabling the conversion based on wether the
button to convert is enabled. Out of scope of the PR is fine tuning
actual conversions, we'll pick that up in follow-ups.


https://github.com/user-attachments/assets/d545c759-417b-4705-a820-bc669ca17ae2

### To test that the conversion button isn't showing up in production
builds:

```
# local kibana build
node scripts/build --skip-os-packages --skip-docker-contexts

# create ./build/default/kibana-9.4.0-SNAPSHOT-darwin-aarch64/config/kibana.yml
elasticsearch.hosts:
  - https://localhost:9200/
elasticsearch.password: ****
elasticsearch.username: kibana_system

# run kibana
./build/default/kibana-9.4.0-SNAPSHOT-darwin-aarch64/bin/kibana --elasticsearch.ssl.verificationMode=none
```

### Checklist

- [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
- [x] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [x] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.
- [x] Used `cursor-cli` with `opus-4.5` to refactor the PoCs onto the
new UI flow.

---------

Co-authored-by: Stratou <efstratia.kalafateli@elastic.co>
hannahbrooks pushed a commit to hannahbrooks/kibana that referenced this pull request Jan 30, 2026
## Summary

Follow up to elastic#246209. Implements
elastic/kibana-team#2391. Also implements part
of elastic/kibana-team#2179.

This applies the work done in PoCs elastic#199632 and elastic#245716 to the new UI
flow with the conversion modal added in elastic#246209.

This PR wires up the ES|QL conversion modal to actually perform the
datasource conversion. Related to that, it also cleans up the inline
editing flyout code by removing redundant props.

- `handleConvertToEsql` callback to switch flyout from formBased to
textBased mode
- Updates visualization state to remap column IDs (xAccessor, accessors,
splitAccessor) to ES|QL field names
- Reduces prop drilling of `datasourceId` and `canEditTextBasedQuery`,
adds `hideTextBasedEditor` to Redux state for Discover integration.

Note: The full feature is still behind a dev-mode flag, it's not enabled
in production. The scope of this PR is to enable the full UI flow of
DSL->ES|QL conversion and enabling the conversion based on wether the
button to convert is enabled. Out of scope of the PR is fine tuning
actual conversions, we'll pick that up in follow-ups.


https://github.com/user-attachments/assets/d545c759-417b-4705-a820-bc669ca17ae2

### To test that the conversion button isn't showing up in production
builds:

```
# local kibana build
node scripts/build --skip-os-packages --skip-docker-contexts

# create ./build/default/kibana-9.4.0-SNAPSHOT-darwin-aarch64/config/kibana.yml
elasticsearch.hosts:
  - https://localhost:9200/
elasticsearch.password: ****
elasticsearch.username: kibana_system

# run kibana
./build/default/kibana-9.4.0-SNAPSHOT-darwin-aarch64/bin/kibana --elasticsearch.ssl.verificationMode=none
```

### Checklist

- [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
- [x] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [x] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.
- [x] Used `cursor-cli` with `opus-4.5` to refactor the PoCs onto the
new UI flow.

---------

Co-authored-by: Stratou <efstratia.kalafateli@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants