Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Lens][ES|QL] Re-running the query should keep the selected configuration if possible #186366

Closed
stratoula opened this issue Jun 18, 2024 · 5 comments · Fixed by #210780
Closed
Assignees
Labels
enhancement New value added to drive a business result Feature:ES|QL ES|QL related features in Kibana impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. Team:ESQL ES|QL related features in Kibana Team:Visualizations Visualization editors, elastic-charts and infrastructure

Comments

@stratoula
Copy link
Contributor

stratoula commented Jun 18, 2024

Describe the feature:

Right now, every time a user submits a query in the editor, the Lens suggestions api runs and suggests a new chart. This results in changed made in the visualization level to be lost.

It would be cool if we could at least prioritize the activeVisualization chart Type and some of the configuration if is valid. The type will be very easy as the suggestions api can already do it (with the preferredChartType property). The visualization state is lost though (colors, legend settings etc).

We need to:

  • ask from the suggestions api to prirotize the current visualizationType
  • check if the query hasn't introduced major changes in the columns (check that the used columns in the datasourceState are being returned from the new query and in that case not change the chart (so keep the config)
  • if the columns are different we can just keep the visualization type and render the attributes returned from the suggestions api.
@stratoula stratoula added Team:Visualizations Visualization editors, elastic-charts and infrastructure impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. Feature:ES|QL ES|QL related features in Kibana Team:ESQL ES|QL related features in Kibana labels Jun 18, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-visualizations (Team:Visualizations)

@elasticmachine
Copy link
Contributor

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

@stratoula stratoula added the enhancement New value added to drive a business result label Jun 18, 2024
@stratoula
Copy link
Contributor Author

stratoula commented Jun 18, 2024

As a feature related to ES|QL and of a mid - high impact I am adding this on the ES|QL project team roadmap. Related to #184631

@stratoula stratoula changed the title [Lens][ES|QL] Re-running the query should keep the selected chart type if possible [Lens][ES|QL] Re-running the query should keep the selected configuration if possible Sep 23, 2024
@stratoula
Copy link
Contributor Author

I think that this needs to wait for the Lens embeddable refactor

@markov00
Copy link
Member

this is unblocked now

@stratoula stratoula self-assigned this Feb 12, 2025
stratoula added a commit to stratoula/kibana that referenced this issue Feb 21, 2025
…0780)

## Summary

Closes elastic#186366

![meow](https://github.com/user-attachments/assets/6e5bd59a-2dcb-4b0e-a0a3-1ed15a64306f)

It keeps the chart configuration when the user is doing actions
compatible with the current query such as:

- Adding a where filter
- Changing to a compatible chart type (from example from bar to line or
pie to treemap)
- In general changing the query that doesnt affect the generated columns
mapped to a chart.

### Release notes

Keeps the chart configuration changes done by the user when changing the
query whenever it is possible.

### 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
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] 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)

(cherry picked from commit cb77b97)

# Conflicts:
#	src/platform/packages/private/kbn-esql-editor/src/esql_editor.tsx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New value added to drive a business result Feature:ES|QL ES|QL related features in Kibana impact:medium Addressing this issue will have a medium level of impact on the quality/strength of our product. Team:ESQL ES|QL related features in Kibana Team:Visualizations Visualization editors, elastic-charts and infrastructure
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants