Skip to content

[ES|QL] Validation and autocomplete support for the CHANGE_POINT command#216043

Merged
darnautov merged 18 commits intoelastic:mainfrom
darnautov:esql-211543-change-point-validation
Apr 1, 2025
Merged

[ES|QL] Validation and autocomplete support for the CHANGE_POINT command#216043
darnautov merged 18 commits intoelastic:mainfrom
darnautov:esql-211543-change-point-validation

Conversation

@darnautov
Copy link
Contributor

@darnautov darnautov commented Mar 26, 2025

Summary

Closes #211543

Adds validation and autocomplete support for the CHANGE_POINT command

Checklist

  • Unit or functional tests were updated or added to match the most common scenarios
  • The PR description includes the appropriate Release Notes section, and the correct release_note:* label is applied per the guidelines
@darnautov darnautov added release_note:enhancement Team:ESQL ES|QL related features in Kibana t// labels Mar 26, 2025
@darnautov darnautov self-assigned this Mar 26, 2025
@darnautov darnautov requested review from drewdaemon, stratoula and vadimkibana and removed request for stratoula March 26, 2025 13:32
@darnautov darnautov marked this pull request as ready for review March 26, 2025 18:14
@darnautov darnautov requested a review from a team as a code owner March 26, 2025 18:14
@elasticmachine
Copy link
Contributor

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

@elastic-vault-github-plugin-prod elastic-vault-github-plugin-prod bot requested a review from a team as a code owner March 26, 2025 18:40
@drewdaemon drewdaemon added the backport:version Backport to applied version labels label Mar 26, 2025
Copy link
Contributor

@drewdaemon drewdaemon left a comment

Choose a reason for hiding this comment

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

Looking great! I think we could make the query typing experience a bit smoother with some well-placed suggestion triggers.

Comment on lines 124 to 127
case Position.AS_P_VALUE_COLUMN: {
const suggestions: SuggestionRawDefinition[] = buildVariablesDefinitions(['pValue']);
return suggestions;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Bonus points would be to offer a pipe suggestion at the end of this word without requiring the user to press the spacebar. See here for an example of how to do it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added in 99ea4f9

Copy link
Contributor

Choose a reason for hiding this comment

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

You implemented it basically correctly, but as it stands now I don't think it is much of an add to the UX.

handleFragment is useful when we have a clear definition of complete/incomplete words. For example, we know that you either need ASC or DESC after SORT. So we can keep suggesting ASC as the user types the first letters AS and then when they have finished typing ASC we give them a suggestion to advance them.

In this case as you've explained it to me, there's nothing special about the word, pValue. So, there is no way for us to confidently know when a user is finished typing the word.

So, I think we can just revert that commit and call it a day. Sorry, I didn't understand the situation initially.

@stratoula stratoula removed the request for review from a team March 27, 2025 15:21
@darnautov darnautov requested a review from drewdaemon March 31, 2025 13:22
Copy link
Contributor

@drewdaemon drewdaemon left a comment

Choose a reason for hiding this comment

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

Nice work Dima, the UX flows much better.

I would say just forget about handleFragment... sorry for the noise.

I'll approve so as not to block you further.

@darnautov darnautov enabled auto-merge (squash) April 1, 2025 12:18
@darnautov darnautov merged commit d35b608 into elastic:main Apr 1, 2025
9 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.x

https://github.com/elastic/kibana/actions/runs/14197599749

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
esql 189 190 +1
lists 420 421 +1
securitySolution 7170 7171 +1
unifiedSearch 348 349 +1
total +4

Page load bundle

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

id before after diff
kbnUiSharedDeps-srcJs 3.6MB 3.6MB +3.2KB

History

cc @darnautov

kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Apr 1, 2025
…mmand (elastic#216043)

## Summary

Closes elastic#211543

Adds validation and autocomplete support for the `CHANGE_POINT` command

### 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] 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)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
(cherry picked from commit d35b608)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

@darnautov darnautov deleted the esql-211543-change-point-validation branch April 1, 2025 15:24
kibanamachine added a commit that referenced this pull request Apr 1, 2025
…NT` command (#216043) (#216657)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[ES|QL] Validation and autocomplete support for the `CHANGE_POINT`
command (#216043)](#216043)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Dima
Arnautov","email":"dmitrii.arnautov@elastic.co"},"sourceCommit":{"committedDate":"2025-04-01T13:58:13Z","message":"[ES|QL]
Validation and autocomplete support for the `CHANGE_POINT` command
(#216043)\n\n## Summary\n\nCloses
https://github.com/elastic/kibana/issues/211543\n\nAdds validation and
autocomplete support for the `CHANGE_POINT` command\n\n###
Checklist\n\n- [x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [x] The PR
description includes the appropriate Release Notes section,\nand the
correct `release_note:*` label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"d35b60896dec8dbe2a265cd1db05c63a4d9ce536","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:enhancement","Team:ESQL","backport:version","v9.1.0","v8.19.0"],"title":"[ES|QL]
Validation and autocomplete support for the `CHANGE_POINT`
command","number":216043,"url":"https://github.com/elastic/kibana/pull/216043","mergeCommit":{"message":"[ES|QL]
Validation and autocomplete support for the `CHANGE_POINT` command
(#216043)\n\n## Summary\n\nCloses
https://github.com/elastic/kibana/issues/211543\n\nAdds validation and
autocomplete support for the `CHANGE_POINT` command\n\n###
Checklist\n\n- [x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [x] The PR
description includes the appropriate Release Notes section,\nand the
correct `release_note:*` label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"d35b60896dec8dbe2a265cd1db05c63a4d9ce536"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/216043","number":216043,"mergeCommit":{"message":"[ES|QL]
Validation and autocomplete support for the `CHANGE_POINT` command
(#216043)\n\n## Summary\n\nCloses
https://github.com/elastic/kibana/issues/211543\n\nAdds validation and
autocomplete support for the `CHANGE_POINT` command\n\n###
Checklist\n\n- [x] [Unit or
functional\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\nwere
updated or added to match the most common scenarios\n- [x] The PR
description includes the appropriate Release Notes section,\nand the
correct `release_note:*` label is applied per
the\n[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)\n\n---------\n\nCo-authored-by:
kibanamachine
<42973632+kibanamachine@users.noreply.github.com>","sha":"d35b60896dec8dbe2a265cd1db05c63a4d9ce536"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

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

Labels

backport:version Backport to applied version labels release_note:enhancement Team:ESQL ES|QL related features in Kibana t// v8.19.0 v9.1.0

4 participants