[ES|QL] Creates control by typing a questionmark#216839
[ES|QL] Creates control by typing a questionmark#216839stratoula merged 21 commits intoelastic:mainfrom
Conversation
|
Pinging @elastic/kibana-esql (Team:ESQL) |
drewdaemon
left a comment
There was a problem hiding this comment.
Very nice feature. Have you thought about detecting a double question mark? It doesn't currently seem very well supported
two-marks.mov
Also, it would be nice if I didn't lose my flyout width
Screen.Recording.2025-04-07.at.1.33.34.PM.mov
...n-esql-validation-autocomplete/src/autocomplete/__tests__/autocomplete.command.limit.test.ts
Show resolved
Hide resolved
| const lastCharacterTyped = innerText[innerText.length - 1]; | ||
| let controlSuggestions: SuggestionRawDefinition[] = []; | ||
| if (lastCharacterTyped === '?') { | ||
| controlSuggestions = getControlSuggestionIfSupported( | ||
| Boolean(supportsControls), | ||
| ESQLVariableType.VALUES, | ||
| getVariables | ||
| ); | ||
| } | ||
|
|
There was a problem hiding this comment.
Are you ever going to have controls outside of an expression? If not, it seems like this logic belongs in suggestForExpression, though we may have to wait until #216492 so that it can be fully supported. If you agree, can we add a TODO comment here?
Also, why not return the suggestion right here instead of letting the other routines complete?
There was a problem hiding this comment.
I am not sure how the feature will evolve tbh. I know we will have them in sources for example but that is all I know.l It really depends on the users' requests I guess. But nevertheless I added a ToDo as you suggested 15df991
Also, why not return the suggestion right here instead of letting the other routines complete?
It is on purpose! I wanted mostly to avoid this
There was a problem hiding this comment.
I am not sure how the feature will evolve tbh. I know we will have them in sources for example but that is all I know.l It really depends on the users' requests I guess. But nevertheless I added a ToDo as you suggested 15df991
Yeah makes sense. ++ to waiting to see how it evolves!
It is on purpose! I wanted mostly to avoid this
Ok, then why don't we move it to just below the new command suggestions branch?
My concern is that right now we are allowing the function and command suggestions routines to run and then discarding the result if there is a create control suggestion.
...rm/packages/shared/kbn-esql-validation-autocomplete/src/autocomplete/commands/stats/index.ts
Outdated
Show resolved
Hide resolved
We don't want this (at least not now).
Irrelevant with this PR. Not sure how important it is but if any user complains we can consider ofc. It happens in many places irrelevant with controls such as dashboards or Discover. Anyway out of the scope of this PR for sure and def not a simple thing to solve. |
That's fine that it isn't relevant to the work here or even to this particular project. But I think it's something that is obviously annoying without needing a user to go to the trouble of complaining to a PM about it. I hope we solve it everywhere 🤞 |
💚 Build Succeeded
Metrics [docs]Async chunks
Page load bundle
History
|
|
Starting backport for target branches: 8.x |
## Summary Closes elastic#213877 Gives the users the ability to create a control by typing a ?   ### 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 (cherry picked from commit 751e44d)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…7669) # Backport This will backport the following commits from `main` to `8.x`: - [[ES|QL] Creates control by typing a questionmark (#216839)](#216839) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Stratoula Kalafateli","email":"efstratia.kalafateli@elastic.co"},"sourceCommit":{"committedDate":"2025-04-09T12:39:19Z","message":"[ES|QL] Creates control by typing a questionmark (#216839)\n\n## Summary\n\nCloses https://github.com/elastic/kibana/issues/213877\n\nGives the users the ability to create a control by typing a ?\n\n\n\n\n\n\n\n### Checklist\n\n- [ ] [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","sha":"751e44d5da6c9067904032a9524736b44f092e48","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:feature","Feature:ES|QL","Team:ESQL","backport:version","v9.1.0","v8.19.0"],"title":"[ES|QL] Creates control by typing a questionmark","number":216839,"url":"https://github.com/elastic/kibana/pull/216839","mergeCommit":{"message":"[ES|QL] Creates control by typing a questionmark (#216839)\n\n## Summary\n\nCloses https://github.com/elastic/kibana/issues/213877\n\nGives the users the ability to create a control by typing a ?\n\n\n\n\n\n\n\n### Checklist\n\n- [ ] [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","sha":"751e44d5da6c9067904032a9524736b44f092e48"}},"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/216839","number":216839,"mergeCommit":{"message":"[ES|QL] Creates control by typing a questionmark (#216839)\n\n## Summary\n\nCloses https://github.com/elastic/kibana/issues/213877\n\nGives the users the ability to create a control by typing a ?\n\n\n\n\n\n\n\n### Checklist\n\n- [ ] [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","sha":"751e44d5da6c9067904032a9524736b44f092e48"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
Summary
Closes #213877
Gives the users the ability to create a control by typing a ?
Checklist