[ES|QL] Validation and autocomplete support for the CHANGE_POINT command#216043
[ES|QL] Validation and autocomplete support for the CHANGE_POINT command#216043darnautov merged 18 commits intoelastic:mainfrom
CHANGE_POINT command#216043Conversation
...platform/packages/shared/kbn-esql-validation-autocomplete/src/autocomplete/complete_items.ts
Show resolved
Hide resolved
|
Pinging @elastic/kibana-esql (Team:ESQL) |
drewdaemon
left a comment
There was a problem hiding this comment.
Looking great! I think we could make the query typing experience a bit smoother with some well-placed suggestion triggers.
src/platform/packages/shared/kbn-esql-validation-autocomplete/src/definitions/commands.ts
Outdated
Show resolved
Hide resolved
...ages/shared/kbn-esql-validation-autocomplete/src/autocomplete/commands/change_point/index.ts
Outdated
Show resolved
Hide resolved
...ages/shared/kbn-esql-validation-autocomplete/src/autocomplete/commands/change_point/index.ts
Outdated
Show resolved
Hide resolved
...ages/shared/kbn-esql-validation-autocomplete/src/autocomplete/commands/change_point/index.ts
Outdated
Show resolved
Hide resolved
| case Position.AS_P_VALUE_COLUMN: { | ||
| const suggestions: SuggestionRawDefinition[] = buildVariablesDefinitions(['pValue']); | ||
| return suggestions; | ||
| } |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
...ages/shared/kbn-esql-validation-autocomplete/src/autocomplete/commands/change_point/index.ts
Outdated
Show resolved
Hide resolved
src/platform/packages/shared/kbn-esql-validation-autocomplete/src/definitions/commands.ts
Outdated
Show resolved
Hide resolved
src/platform/packages/shared/kbn-esql-validation-autocomplete/src/definitions/commands.ts
Show resolved
Hide resolved
…ion' into esql-211543-change-point-validation
drewdaemon
left a comment
There was a problem hiding this comment.
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.
|
Starting backport for target branches: 8.x |
💚 Build Succeeded
Metrics [docs]Module Count
Page load bundle
History
cc @darnautov |
…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)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…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>
Summary
Closes #211543
Adds validation and autocomplete support for the
CHANGE_POINTcommandChecklist
release_note:*label is applied per the guidelines