Skip to content

[ES|QL] new pattern for SORT autocomplete#193595

Merged
drewdaemon merged 10 commits intoelastic:mainfrom
drewdaemon:make-sort-awesome
Sep 23, 2024
Merged

[ES|QL] new pattern for SORT autocomplete#193595
drewdaemon merged 10 commits intoelastic:mainfrom
drewdaemon:make-sort-awesome

Conversation

@drewdaemon
Copy link
Copy Markdown
Contributor

@drewdaemon drewdaemon commented Sep 20, 2024

Summary

Part of #189662. This PR

  • updates the autocomplete behavior for SORT to be in line with other field-list-based experiences like KEEP
  • introduces a shared function, handleFragment, which is used to abstract some of the logic required to support this behavior
  • bulks up the SORT tests
  • restores the function suggestions which I noticed got lost in [ES|QL] Implement OrderExpression for SORT command arguments #189959

Before

Screen.Recording.2024-09-20.at.8.33.19.AM.mov

After

Screen.Recording.2024-09-20.at.8.31.20.AM.mov

Checklist

@drewdaemon drewdaemon added Feature:ES|QL ES|QL related features in Kibana Team:ESQL ES|QL related features in Kibana t// release_note:enhancement backport:prev-minor labels Sep 20, 2024
@elasticmachine
Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Contributor

@stratoula stratoula left a comment

Choose a reason for hiding this comment

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

Nice, LGTM!

* @TODO — this string manipulation is crude and can't support all cases
* Checking for a partial word and computing the replacement range should
* really be done using the AST node, but we'll have to refactor further upstream
* to make that available. This is a quick fix to support the most common case.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍

Where are we tracking this refactoring?

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.

Nowhere except the RFC at this point

@kibana-ci
Copy link
Copy Markdown

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

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.4MB 3.4MB +874.0B

History

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

@drewdaemon drewdaemon merged commit f450e22 into elastic:main Sep 23, 2024
@kibanamachine
Copy link
Copy Markdown
Contributor

kibanamachine commented Sep 23, 2024

💔 All backports failed

Status Branch Result
8.x Backport failed because of merge conflicts

You might need to backport the following PRs to 8.x:
- [ES|QL] Implement OrderExpression for SORT command arguments (#189959)

Manual backport

To create the backport manually run:

node scripts/backport --pr 193595

Questions ?

Please refer to the Backport tool documentation

weizijun added a commit to weizijun/kibana that referenced this pull request Sep 23, 2024
* main: (176 commits)
  [ML][Rules] Fixes deletion in Check interval input for anomaly detection rule (elastic#193420)
  Bump maximum supported package spec version to 3.2 (elastic#193574)
  [ES|QL] new pattern for `SORT` autocomplete (elastic#193595)
  [Inventory][ECO] Entities page search bar (elastic#193546)
  [Synthetics] Remove extra overview route (elastic#192449)
  [Obs Alerts table] Fix error on clicking alert reason message (elastic#193693)
  [Migrations] Remove tests that are not applicable in 9.x (elastic#193699)
  [EDR Workflows] Set Agent Tamper Protection to false on policy unassignment (elastic#193017)
  [Inventory][ECO] Enable elastic entity model from inventory (elastic#193557)
  [EDR Workflows] The host isolation exception tab is hidden on the basic license if no artifacts (elastic#192562)
  [Entity Analytics] Ensuring definition transforms are managed (elastic#193408)
  [Automatic Import] Do not remove message field for unstructured logs (elastic#193678)
  [Fleet] Add missing permissions for connector package (elastic#193573)
  [Fleet] using @kbn/config-schema part 2 (outputs and other apis)  (elastic#193326)
  [Migrations] Provide testing archives + tooling for migrations integration tests (elastic#193328)
  [ES|QL] Renames the textbased editor to esql editor (elastic#193521)
  [ES|QL] Update function metadata (elastic#193662)
  [Security Solution][Entity Analytics] Scoping the entity store to spaces (elastic#193303)
  [Docs] Update Sharing docs (elastic#190318)
  [ML] AIOps: Move Log Rate Analysis results callout to help popover. (elastic#192243)
  ...

# Conflicts:
#	x-pack/plugins/search_inference_endpoints/public/components/all_inference_endpoints/render_table_columns/render_endpoint/endpoint_info.test.tsx
#	x-pack/plugins/search_inference_endpoints/public/components/all_inference_endpoints/render_table_columns/render_endpoint/endpoint_info.tsx
@drewdaemon
Copy link
Copy Markdown
Contributor Author

I think the backport failed because #193379 hasn't yet merged

@drewdaemon
Copy link
Copy Markdown
Contributor Author

💚 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

drewdaemon added a commit to drewdaemon/kibana that referenced this pull request Sep 23, 2024
## Summary

Part of elastic#189662. This PR
- updates the autocomplete behavior for `SORT` to be in line with other
field-list-based experiences like `KEEP`
- introduces a shared function, `handleFragment`, which is used to
abstract some of the logic required to support this behavior
- bulks up the `SORT` tests
- restores the function suggestions which I noticed got lost in
elastic#189959

**Before**

https://github.com/user-attachments/assets/cad1d073-c010-426f-9628-c0fc6b65eb3c

**After**

https://github.com/user-attachments/assets/e148ae58-4430-482c-9f8e-c55779c4d822

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

---------

Co-authored-by: Stratoula Kalafateli <efstratia.kalafateli@elastic.co>
(cherry picked from commit f450e22)
drewdaemon added a commit that referenced this pull request Sep 24, 2024
# Backport

This will backport the following commits from `main` to `8.x`:
- [[ES|QL] new pattern for `SORT` autocomplete
(#193595)](#193595)

<!--- Backport version: 8.9.8 -->

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

<!--BACKPORT [{"author":{"name":"Drew
Tate","email":"drew.tate@elastic.co"},"sourceCommit":{"committedDate":"2024-09-23T14:23:23Z","message":"[ES|QL]
new pattern for `SORT` autocomplete (#193595)\n\n## Summary\r\n\r\nPart
of #189662. This PR\r\n- updates
the autocomplete behavior for `SORT` to be in line with
other\r\nfield-list-based experiences like `KEEP`\r\n- introduces a
shared function, `handleFragment`, which is used to\r\nabstract some of
the logic required to support this behavior\r\n- bulks up the `SORT`
tests\r\n- restores the function suggestions which I noticed got lost
in\r\nhttps://github.com//pull/189959\r\n\r\n**Before**\r\n\r\n\r\nhttps://github.com/user-attachments/assets/cad1d073-c010-426f-9628-c0fc6b65eb3c\r\n\r\n**After**\r\n\r\n\r\nhttps://github.com/user-attachments/assets/e148ae58-4430-482c-9f8e-c55779c4d822\r\n\r\n###
Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: Stratoula Kalafateli
<efstratia.kalafateli@elastic.co>","sha":"f450e228b38d317a57d906f6c59f6e69d1dd458d","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:enhancement","v9.0.0","backport:prev-minor","Feature:ES|QL","Team:ESQL"],"number":193595,"url":"https://github.com/elastic/kibana/pull/193595","mergeCommit":{"message":"[ES|QL]
new pattern for `SORT` autocomplete (#193595)\n\n## Summary\r\n\r\nPart
of #189662. This PR\r\n- updates
the autocomplete behavior for `SORT` to be in line with
other\r\nfield-list-based experiences like `KEEP`\r\n- introduces a
shared function, `handleFragment`, which is used to\r\nabstract some of
the logic required to support this behavior\r\n- bulks up the `SORT`
tests\r\n- restores the function suggestions which I noticed got lost
in\r\nhttps://github.com//pull/189959\r\n\r\n**Before**\r\n\r\n\r\nhttps://github.com/user-attachments/assets/cad1d073-c010-426f-9628-c0fc6b65eb3c\r\n\r\n**After**\r\n\r\n\r\nhttps://github.com/user-attachments/assets/e148ae58-4430-482c-9f8e-c55779c4d822\r\n\r\n###
Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: Stratoula Kalafateli
<efstratia.kalafateli@elastic.co>","sha":"f450e228b38d317a57d906f6c59f6e69d1dd458d"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/193595","number":193595,"mergeCommit":{"message":"[ES|QL]
new pattern for `SORT` autocomplete (#193595)\n\n## Summary\r\n\r\nPart
of #189662. This PR\r\n- updates
the autocomplete behavior for `SORT` to be in line with
other\r\nfield-list-based experiences like `KEEP`\r\n- introduces a
shared function, `handleFragment`, which is used to\r\nabstract some of
the logic required to support this behavior\r\n- bulks up the `SORT`
tests\r\n- restores the function suggestions which I noticed got lost
in\r\nhttps://github.com//pull/189959\r\n\r\n**Before**\r\n\r\n\r\nhttps://github.com/user-attachments/assets/cad1d073-c010-426f-9628-c0fc6b65eb3c\r\n\r\n**After**\r\n\r\n\r\nhttps://github.com/user-attachments/assets/e148ae58-4430-482c-9f8e-c55779c4d822\r\n\r\n###
Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios\r\n\r\n---------\r\n\r\nCo-authored-by: Stratoula Kalafateli
<efstratia.kalafateli@elastic.co>","sha":"f450e228b38d317a57d906f6c59f6e69d1dd458d"}}]}]
BACKPORT-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature:ES|QL ES|QL related features in Kibana release_note:enhancement Team:ESQL ES|QL related features in Kibana t// v8.16.0 v9.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants