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

[ES|QL] Query History #173217

Closed
timductive opened this issue Dec 12, 2023 · 4 comments · Fixed by #178302
Closed

[ES|QL] Query History #173217

timductive opened this issue Dec 12, 2023 · 4 comments · Fixed by #178302
Assignees
Labels
enhancement New value added to drive a business result epic 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

Comments

@timductive
Copy link
Member

timductive commented Dec 12, 2023

The query history feature aims to enhance user experience in ES|QL by providing a list of recently executed queries to the user.

image

There are six main user stories for this MVP release of this feature, and they are described below:

ID Title Requirement Ready-for-development
1 Access to recent queries Users can access a list of the last 20 x ESQL queries that they have executed in that browser
2 Re-run the query by selecting a query history item Allows users to easily locate and rerun specific queries from the history list without retyping.
3 Be able to copy a query from the query history list. Users should be able to copy a “Query History Item”
4 View details/metadata information about the query, when it was run and duration Users should be able to view metadata information about each query for “Time ran” and “Last Duration” which indicates when the query was executed and how long the duration was.
5 View if the query was successful, errored, or had a warning in the query history list view. As a user, I want to see if the query I ran was successful, errored, or had warnings.
6 Re-size the query history and/or the ESQL editor As a user, I want to be able to re-size the Query History part of the editor or/and the ESQL query builder.

Note

The query history will be available in these ES|QL editors:

  • Compact Editor
  • Expanded Editor
  • In-line Editor

Storage:

  • These are not saved queries, just executed/run queries run by the user logged in working in that browser
  • The queries are stored in the browser, which means e.g. that they are not accessible in a different browser, and are temporarily stored.
  • We should ensure storing them in a secure way in the browser.

Storing successful vs errored queries:
The reason for not storing many errored queries is that many new users would have syntax errors while learning ESIQL and it would pollute the limited query history items with irrelevant items.

  • We will have two buckets to store the query history items.
  • One to store successful queries and queries with warnings
  • Another bucket for error-pruned queries. We will only show the last 5 errored/failed queries and the last 15 successful and/or with a warning. 20 query history items in total.
@timductive timductive added enhancement New value added to drive a business result 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. epic Feature:ES|QL ES|QL related features in Kibana labels Dec 12, 2023
@elasticmachine
Copy link
Contributor

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

@ninoslavmiskovic
Copy link
Contributor

@stratoula , @timductive and @MichaelMarcialis - I have updated this issue with the main user stories and details. Take a look.

@ryankeairns
Copy link
Contributor

Capturing some design clarifications from a Slack/EUI thread on the main 'Run query' button.

With the One Discover/ES|QL-first efforts we are also considering changes to the Run button (granted, it is earlier on).

  • Andrea and I were looking to use the secondary green color to better differentiate the ES|QL mode (from the data view-oriented mode) and gain more contrast to the other primary CTA (Save).
  • Design feedback on the wireframe shared above - we aligned that the shortcut could be in a tooltip, instead of inside the button

Once the EUI side of this is done (enabling overrides of the button text), we can then make the following overrides on the Kibana side:

  • Keep it blue/primary for now (no change to color)
  • Change the label to Run
  • Show the play icon
  • Show the keyboard shortcut in a (delayed) tooltip

End result for this pass:

CleanShot 2024-03-12 at 10 50 45@2x

Later, we can consider further evolving the styles (e.g. to green, maybe icon-only) as the other initiatives progress.

@stratoula stratoula mentioned this issue Mar 25, 2024
9 tasks
@stratoula stratoula added Team:ESQL ES|QL related features in Kibana and removed Team:Visualizations Visualization editors, elastic-charts and infrastructure labels Mar 27, 2024
@elasticmachine
Copy link
Contributor

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

stratoula added a commit that referenced this issue Mar 28, 2024
## Summary

Closes #173217

Implements the query history component in the ESQL editor. The query
history component displays the 20 most recent queries and it doesn't
duplicate. If the user reruns a query it will update an existing one and
not create a new entry.

<img width="1676" alt="image"
src="https://github.com/elastic/kibana/assets/17003240/23c8822d-3520-4952-b6cf-9cf7bb486389">

<img width="1678" alt="image"
src="https://github.com/elastic/kibana/assets/17003240/3fdeccbc-5763-46c6-a940-e2b39dd95179">

### Important notes

Right now, the query history component has been implemented at:

- Unified search ES|QL editor
- Lens inline editing component
- Alerts
- Maps

I have hid it from ML data visualizer because it was very difficult to
implement it there. There is a quite complex logic fetching the fields
statistics so it was a bit complicated to add it there. ML team can
follow up as they know the logic already and would be easier for them to
adjust.

#### Flajy test runner
https://buildkite.com/elastic/kibana-flaky-test-suite-runner/builds/5553

### Checklist

Delete any items that are not applicable to this PR.

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md)
- [x]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [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] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [x] Any UI touched in this PR is usable by keyboard only (learn more
about [keyboard accessibility](https://webaim.org/techniques/keyboard/))
- [x] Any UI touched in this PR does not create any new axe failures
(run axe in browser:
[FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/),
[Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US))
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [x] This renders correctly on smaller devices using a responsive
layout. (You can test this [in your
browser](https://www.browserstack.com/guide/responsive-testing-on-local-server))
- [x] This was checked for [cross-browser
compatibility](https://www.elastic.co/support/matrix#matrix_browsers)

---------

Co-authored-by: kibanamachine <[email protected]>
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 epic 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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants