Skip to content

[ES|QL] Auto open suggestions for field lists#190466

Merged
drewdaemon merged 40 commits intomainfrom
auto-open-suggestions-for-keep-drop
Aug 23, 2024
Merged

[ES|QL] Auto open suggestions for field lists#190466
drewdaemon merged 40 commits intomainfrom
auto-open-suggestions-for-keep-drop

Conversation

@drewdaemon
Copy link
Copy Markdown
Contributor

@drewdaemon drewdaemon commented Aug 13, 2024

Summary

Part of #189662

Suggests comma and pipe

Screen.Recording.2024-08-06.at.5.09.58.PM.mov

Doesn't suggest comma when there are no more fields

Screen.Recording.2024-08-22.at.9.35.51.AM.mov

Doesn't work for escaped columns :(

Screen.Recording.2024-08-22.at.9.38.16.AM.mov

As part of this effort I discovered #191100 and #191105, as well as a problem with column name validation (see #177699)

I think we can revisit column escaping and probably resolve all of these issues (issue here).

Checklist

@drewdaemon drewdaemon changed the title [ES|QL] Auto open suggestions for keep drop [ES|QL] Auto open suggestions for lists Aug 13, 2024
@drewdaemon
Copy link
Copy Markdown
Contributor Author

Blocked on #190465

@drewdaemon drewdaemon changed the title [ES|QL] Auto open suggestions for lists [ES|QL] Auto open suggestions for field lists Aug 22, 2024
@drewdaemon drewdaemon added release_note:enhancement backport:skip This PR does not require backporting Feature:ES|QL ES|QL related features in Kibana Team:ESQL ES|QL related features in Kibana t// labels Aug 22, 2024
@drewdaemon
Copy link
Copy Markdown
Contributor Author

/ci

@drewdaemon drewdaemon marked this pull request as ready for review August 22, 2024 19:07
@drewdaemon drewdaemon requested a review from a team as a code owner August 22, 2024 19:07
@elasticmachine
Copy link
Copy Markdown
Contributor

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

@drewdaemon drewdaemon requested a review from ryankeairns August 22, 2024 19:07
@kibana-ci
Copy link
Copy Markdown

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
securitySolution 5674 5675 +1

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/esql-validation-autocomplete 183 184 +1

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
securitySolution 18.0MB 18.0MB -12.0B

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.3MB 3.3MB +883.0B
Unknown metric groups

API count

id before after diff
@kbn/esql-validation-autocomplete 195 196 +1

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Copy link
Copy Markdown
Contributor

@ryankeairns ryankeairns left a comment

Choose a reason for hiding this comment

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

Gave it a go, felt good, and work as described!

Also, nice finds on those other issues.

'date_period[]',
] as const;

export type ArrayType = (typeof arrayTypes)[number];
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice!

*/
export function extractSingularType(type: FunctionParameterType): FunctionParameterType {
return arrayToSingularMap.get(type) ?? type;
return isArrayType(type) ? arrayToSingularMap.get(type)! : type;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looking at this again, will there ever be a case where we can not remove the last [] in the text to get the singular type? Do we need to look up a map for it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We could always just remove the [] through string manipulation. I like the map because it makes it clear which types can be arrays. I guess this whole array types thing makes me nervous because I don't have a good handle yet on its purpose. So, I like being a bit more explicit.

Open to opinions though.

@qn895
Copy link
Copy Markdown
Member

qn895 commented Aug 23, 2024

Tested and LGTM 🎉

@drewdaemon drewdaemon merged commit 15ef37f into main Aug 23, 2024
@drewdaemon drewdaemon deleted the auto-open-suggestions-for-keep-drop branch August 23, 2024 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting Feature:ES|QL ES|QL related features in Kibana release_note:enhancement Team:ESQL ES|QL related features in Kibana t// v8.16.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants