[Lens] [ES|QL] Lens ES|QL flyout "Apply and close" button's UX improvement#247625
Conversation
- Add client-side ES|QL syntax error detection using Parser.parseErrors() - Disable 'Apply and close' button when: - ES|QL query has syntax errors - ES|QL query has been changed but not yet run - ES|QL query has runtime errors after execution - Show contextual tooltip messages explaining why button is disabled - Remove isNewPanel bypass so new panels are also validated - Add getESQLQuerySyntaxErrors() utility to kbn-esql-utils package
…ns-Apply-and-clse-button-UX-Improvements
|
Pinging @elastic/kibana-visualizations (Team:Visualizations) |
…d behavior via test.
…ns-Apply-and-clse-button-UX-Improvements
|
I am not sure about this tbh. The query needs to run first. If it doesnt run then the apply and close will save the previous run query. Checking the query (if it is valid or not) while the user hasn't run it yet and disabling the apply button is a bit confusing with the current UX. I think we need to discuss it first befiore we decide on how to improve the experience here. |
|
Thanks for having a look at this @stratoula. Yes, would be great if we come up with an agreed upon UX.
If you mean "apply and close should save the previous run query" This behavior is described as a bug in #243770 (see point |
Hey, thanks for replying. No I don't mean that. I just dont get why we check for the query syntax validation when we are already prompting the users to run the query first. If they run it and has syntax errors it will error out and you cover this already |
The However your comment does highlight that we could simplify the flow. One idea is to just have a help text under the editor instead of tooltips on the "Apply and close" button (while the "Apply and close" button will stay disabled until query is run and is successful). Would be great to see what folks think about this. |
…ns-Apply-and-clse-button-UX-Improvements
|
Update 01: Simplified UX around unrun ES|QL query - only help text under the editor and no tooltips Apply-and-close-UX-simplification.mov |
|
@awahab07 thanks, yes I want to simplify the logic and ensure that we really improve the UX here.
|
yeah the editor is already doing this, I dont think we need to duplicate the experience here. |
- Disable Apply button when query is pending submission or has errors - Remove isNewPanel bypass so new panels are also validated - Remove getESQLQuerySyntaxErrors (client-side syntax validation) - Remove help text and tooltip from Apply button - Button is simply disabled without additional messaging
|
Update 02 : No help text either Following the feedback, now there's no help text either. Hopefully, the green ▶︎ Run query button would be enough of an indication that the "Apply and close" button is disabled because the ES|QL query hasn't been run. Would be great to have some design input on this though. Apply-and-close-no-unrun-indication.mov |
…ns-Apply-and-clse-button-UX-Improvements # Conflicts: # x-pack/platform/plugins/shared/lens/public/app_plugin/shared/edit_on_the_fly/lens_configuration_flyout.tsx
|
I've also noticed a minor quirk (also present on Apply-and-close-button-disabled-at-first-when-changing-chart.movA separate issue should be created if it`s worth fixing. Update: This has been fixed, see. |
|
Thanks @awahab07, this looks good to me. As a nice to have, when the "Apply and Close" button is disable because the user has to run the query first, can we show a tooltip when hovering the disabled button that says "Run the query before saving"? |
teresaalvarezsoler
left a comment
There was a problem hiding this comment.
Works very well! If we can add the tooltip when the button is disabled, that would be great.
Yes, this is a good idea. I'll implement that. |
…ns-Apply-and-clse-button-UX-Improvements
… is disabled due to pending query.
…d ES|QL Discover Session would not enable "Apply and close" button and apply the changed suggestion even when user clicks "Cancel" button.
|
The tooltip on the "Apply and close" button when the button is disabled due to an unrun/pending ES|QL query, has been added back. Run-ESQL-query-tooltip-when-button-is-disabled.mov |
|
Note that the issue mentioned in comment above has been fixed in the same PR as it was making an e2e test fail. The bug: Treemap-to-Pie-chart-Discover-saved-ESQL-session-before.movAfter the fix: Treemap-to-Pie-chart-Discover-saved-ESQL-session-after.mov |
|
@elasticmachine merge upstream |
…n-UX-Improvements
stratoula
left a comment
There was a problem hiding this comment.
This looks exactly what I had in mind and is not very complex. I havent checked the code but from the functionality perspective this seems right! Thank you a lot for applying my feedback
jughosta
left a comment
There was a problem hiding this comment.
Data Discovery changes LGTM
markov00
left a comment
There was a problem hiding this comment.
Please just wait for our eng review
|
@elasticmachine merge upstream |
…n-UX-Improvements
|
@elasticmachine merge upstream |
…n-UX-Improvements
|
@elasticmachine merge upstream |
…n-UX-Improvements
…ns-Apply-and-clse-button-UX-Improvements
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Async chunks
History
|



Fixes #243080
Fixes #243770
Summary
To address the UX quirks mentioned the the parent issues, the PR:
Shows the error help text if updated query hasn't been run, while disabling "Apply and close" button.ES|QL flyout form validation behavior
The "Apply and close" button is now disabled when:
ES|QL query has syntax errors (detected client-side)(Now, query needs to be run first in order to let flyout know if there are syntax errors).Video
The following video demonstrates how the fix addresses the issues mentioned in the parent issues:
243770-Lens-ESQL-ApplyNClose-Button-Behavior-1920x1080.mov
Update 01: Help text instead of tooltips.
Update 02: No help text either.
Update 03: Only a single tooltip.