Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Security Solution] Fix editing in KQL Query Bar #208212

Merged
merged 2 commits into from
Feb 19, 2025

Conversation

jkelas
Copy link
Contributor

@jkelas jkelas commented Jan 24, 2025

Partially resolves: #203523

Summary

Fixing the issue of KQL query bar edit component not showing properly long multiline KQL queries.

The query now isn't fully visible, and it's not possible to navigate with Up/Down keyboard keys. It's also not possible to scroll down, as the component doesn't allow to insert new line symbols.

I am fixing the behavior by:

  • setting the bubbleSubmitEvent={true} so that the key press can propagate to higher components and be served properly. This fixes the problem of not allowing to enter new lines.
  • I am not touching the broken behavior of Up/Down arrow keys, which intercepts the event and instead of moving the cursor, iterates items in the Suggestions panel, which is counterintuitive. Separate issue will be created for the Kibana Visualization team.
  • I am modifying one css style in Kibana Visualization to set height to and adding a class to set proper alignment of buttons.

BEFORE

  • Not possible to insert new lines.
  • Arrow DOWN takes focus to Suggestions Panel, then together with Arrow UP it is used to iterate the suggestions
  • When textarea grows it gets hidden below the parent's panel
Screen.Recording.2025-01-24.at.15.53.10.mov

AFTER

  • Possible to insert new lines
  • Behavior of DOWN / UP Arrows stays the same
  • When textarea grows the whole panel resizes
Screen.Recording.2025-02-11.at.11.53.36.mov
Screen.Recording.2025-02-11.at.11.55.03.mov

@jkelas jkelas added v9.0.0 v8.18.0 bug Fixes for quality problems that affect the customer experience release_note:skip Skip the PR/issue when compiling release notes Team:Detections and Resp Security Detection Response Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:Detection Rule Management Security Detection Rule Management Team Feature:Prebuilt Detection Rules Security Solution Prebuilt Detection Rules area backport:version Backport to applied version labels labels Jan 24, 2025
@jkelas jkelas marked this pull request as ready for review January 24, 2025 15:12
@jkelas jkelas requested review from a team as code owners January 24, 2025 15:12
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-detections-response (Team:Detections and Resp)

@elasticmachine
Copy link
Contributor

Pinging @elastic/security-solution (Team: SecuritySolution)

@elasticmachine
Copy link
Contributor

Pinging @elastic/security-detection-rule-management (Team:Detection Rule Management)

min-height: $euiFormControlHeight;
resize: vertical;
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't believe we want to enable this globally. For starters, it is broken in Discover:
CleanShot 2025-01-24 at 09 29 32@2x

cc:/ @stratoula @ninoslavmiskovic

Copy link
Contributor

Choose a reason for hiding this comment

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

That does not look good. We can't have Discover break like that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right. That was the latest addition to other changes, an improvmeent to add the user ability to change the textarea size manually. I added it because the panel doesn't shrink when I remove some text and I wasn't able to make it work properly. But that's not necessary. I pushed a commit to remove this change.

Copy link
Contributor

@stratoula stratoula Jan 27, 2025

Choose a reason for hiding this comment

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

Have you checked why the FTs are failing? There is a bunch of them which is concerning

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will investigate the issues, thank you @stratoula

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@stratoula I just found a workaround on our side to make this work better. I am leaving only one change on your side, this bubbleSubmitEvent property which solves the issue of inserting new lines.

Copy link
Contributor

Choose a reason for hiding this comment

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

Awesome, are the test failures relevant with this change though?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The test that failed in the previous version of the solution (with changes in kibana visualization only) were relevant, and that's why, after discussion with the team, I withdrew from this idea. We decided to ask your team for implementing this functionality properly, with some attribute that we could set from outside, and in the meantime figure out a workaround, which is what I did in the latest version of the changes.
Now I can see some other tests failing, but these are different than before, in x-pack/platform/plugins/shared/cases/public, which belongs to different team (response-ops)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually there are many more failures. There is a discussion of how to fix this issue in a different way.

@jkelas jkelas force-pushed the 203523_solution_2 branch from 3cb7065 to 5ea239a Compare January 28, 2025 08:30
@jkelas jkelas requested a review from a team as a code owner January 28, 2025 11:32
@jkelas jkelas requested a review from ryankeairns January 29, 2025 11:18
@jkelas jkelas force-pushed the 203523_solution_2 branch from bfb6390 to f5fcbcd Compare January 29, 2025 13:49
@ryankeairns ryankeairns requested review from ryankeairns and removed request for ryankeairns January 29, 2025 17:18
Copy link
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.

Thanks for the changes.
There are no longer SCSS changes, but I am likely stuck on here given my previous review... my approval is in regards to the CSS piece only.

@jkelas
Copy link
Contributor Author

jkelas commented Jan 29, 2025

Thanks for the changes. There are no longer SCSS changes, but I am likely stuck on here given my previous review... my approval is in regards to the CSS piece only.

Thank you @ryankeairns
Actually this version of the PR causes a lot of failures in the build. There is a discussion in slack how to fix the issue in a different way.

@jkelas jkelas force-pushed the 203523_solution_2 branch 3 times, most recently from 8e58646 to 643876c Compare January 31, 2025 12:20
@jkelas jkelas requested a review from ryankeairns February 11, 2025 14:08
@ryankeairns ryankeairns removed their request for review February 11, 2025 14:41
@banderror
Copy link
Contributor

Files by Code Owner

elastic/kibana-visualizations

  • src/platform/plugins/shared/unified_search/public/query_string_input/query_bar_top_row.tsx
  • src/platform/plugins/shared/unified_search/public/search_bar/search_bar.tsx

elastic/security-detection-engine

  • x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/query_bar_field/query_field.tsx
  • x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/index.tsx

elastic/security-detection-rule-management

  • x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/kql_query/kql_query_edit.tsx

elastic/security-solution

  • x-pack/solutions/security/plugins/security_solution/public/common/components/query_bar/index.tsx
  • x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/query_bar_field/query_field.tsx
  • x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_creation_ui/components/step_define_rule/index.tsx
  • x-pack/solutions/security/plugins/security_solution/public/detection_engine/rule_management/components/rule_details/three_way_diff/final_edit/fields/kql_query/kql_query_edit.tsx

Copy link
Contributor

@nickofthyme nickofthyme left a comment

Choose a reason for hiding this comment

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

Vis changes 👍🏼

@jkelas jkelas force-pushed the 203523_solution_2 branch 3 times, most recently from 37aee16 to cfbd1f8 Compare February 18, 2025 08:51
Copy link
Contributor

@rylnd rylnd left a comment

Choose a reason for hiding this comment

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

Detection Engine changes (to the QueryBar component) LGTM! I wasn't aware of the Global component from @emotion, but it looks to apply the fix while not interfering with other styles.

Copy link
Contributor

@nikitaindik nikitaindik left a comment

Choose a reason for hiding this comment

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

Thanks for the PR, @jkelas! I've tested it locally and can confirm that newlines are getting added on "enter" and query content isn't cut off anymore. Left a comment about code, but overall this LGTM!

@jkelas jkelas force-pushed the 203523_solution_2 branch 2 times, most recently from 1a872f2 to 059fc52 Compare February 19, 2025 13:35
@jkelas jkelas enabled auto-merge (squash) February 19, 2025 13:37
@jkelas jkelas merged commit 8159319 into elastic:main Feb 19, 2025
9 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.18, 8.x, 9.0

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

@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #21 / console app misc console behavior keyboard shortcuts should execute the request when Ctrl+Enter is pressed

Metrics [docs]

Async chunks

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

id before after diff
securitySolution 8.9MB 8.9MB +427.0B
unifiedSearch 358.8KB 358.9KB +128.0B
total +555.0B

History

cc @nikitaindik @jkelas

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Feb 19, 2025
**Partially resolves: elastic#203523**

## Summary

Fixing the issue of KQL query bar edit component not showing properly
long multiline KQL queries.

The query now isn't fully visible, and it's not possible to navigate
with Up/Down keyboard keys. It's also not possible to scroll down, as
the component doesn't allow to insert new line symbols.

I am fixing the behavior by:
- setting the `bubbleSubmitEvent={true}` so that the key press can
propagate to higher components and be served properly. This fixes the
problem of not allowing to enter new lines.
- I am not touching the broken behavior of Up/Down arrow keys, which
intercepts the event and instead of moving the cursor, iterates items in
the Suggestions panel, which is counterintuitive. Separate issue will be
created for the Kibana Visualization team.
- I am modifying one css style in Kibana Visualization to set height to
and adding a class to set proper alignment of buttons.

# BEFORE
- Not possible to insert new lines.
- Arrow DOWN takes focus to Suggestions Panel, then together with Arrow
UP it is used to iterate the suggestions
- When textarea grows it gets hidden below the parent's panel

https://github.com/user-attachments/assets/d97b81e3-7409-4089-865d-89ee702744f9

# AFTER
- Possible to insert new lines
- Behavior of DOWN / UP Arrows stays the same
- When textarea grows the whole panel resizes

https://github.com/user-attachments/assets/3a59923b-0fb1-49e7-b11d-55474f465ca2

https://github.com/user-attachments/assets/48efd325-1c66-43ca-9936-69ef37b4ee7a
(cherry picked from commit 8159319)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Feb 19, 2025
**Partially resolves: elastic#203523**

## Summary

Fixing the issue of KQL query bar edit component not showing properly
long multiline KQL queries.

The query now isn't fully visible, and it's not possible to navigate
with Up/Down keyboard keys. It's also not possible to scroll down, as
the component doesn't allow to insert new line symbols.

I am fixing the behavior by:
- setting the `bubbleSubmitEvent={true}` so that the key press can
propagate to higher components and be served properly. This fixes the
problem of not allowing to enter new lines.
- I am not touching the broken behavior of Up/Down arrow keys, which
intercepts the event and instead of moving the cursor, iterates items in
the Suggestions panel, which is counterintuitive. Separate issue will be
created for the Kibana Visualization team.
- I am modifying one css style in Kibana Visualization to set height to
and adding a class to set proper alignment of buttons.

# BEFORE
- Not possible to insert new lines.
- Arrow DOWN takes focus to Suggestions Panel, then together with Arrow
UP it is used to iterate the suggestions
- When textarea grows it gets hidden below the parent's panel

https://github.com/user-attachments/assets/d97b81e3-7409-4089-865d-89ee702744f9

# AFTER
- Possible to insert new lines
- Behavior of DOWN / UP Arrows stays the same
- When textarea grows the whole panel resizes

https://github.com/user-attachments/assets/3a59923b-0fb1-49e7-b11d-55474f465ca2

https://github.com/user-attachments/assets/48efd325-1c66-43ca-9936-69ef37b4ee7a
(cherry picked from commit 8159319)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Feb 19, 2025
**Partially resolves: elastic#203523**

## Summary

Fixing the issue of KQL query bar edit component not showing properly
long multiline KQL queries.

The query now isn't fully visible, and it's not possible to navigate
with Up/Down keyboard keys. It's also not possible to scroll down, as
the component doesn't allow to insert new line symbols.

I am fixing the behavior by:
- setting the `bubbleSubmitEvent={true}` so that the key press can
propagate to higher components and be served properly. This fixes the
problem of not allowing to enter new lines.
- I am not touching the broken behavior of Up/Down arrow keys, which
intercepts the event and instead of moving the cursor, iterates items in
the Suggestions panel, which is counterintuitive. Separate issue will be
created for the Kibana Visualization team.
- I am modifying one css style in Kibana Visualization to set height to
and adding a class to set proper alignment of buttons.

# BEFORE
- Not possible to insert new lines.
- Arrow DOWN takes focus to Suggestions Panel, then together with Arrow
UP it is used to iterate the suggestions
- When textarea grows it gets hidden below the parent's panel

https://github.com/user-attachments/assets/d97b81e3-7409-4089-865d-89ee702744f9

# AFTER
- Possible to insert new lines
- Behavior of DOWN / UP Arrows stays the same
- When textarea grows the whole panel resizes

https://github.com/user-attachments/assets/3a59923b-0fb1-49e7-b11d-55474f465ca2

https://github.com/user-attachments/assets/48efd325-1c66-43ca-9936-69ef37b4ee7a
(cherry picked from commit 8159319)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.18
8.x
9.0

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

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Feb 19, 2025
…1805)

# Backport

This will backport the following commits from `main` to `9.0`:
- [[Security Solution] Fix editing in KQL Query Bar
(#208212)](#208212)

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

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

<!--BACKPORT [{"author":{"name":"Jacek
Kolezynski","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-02-19T15:43:10Z","message":"[Security
Solution] Fix editing in KQL Query Bar (#208212)\n\n**Partially
resolves: #203523**\n\n## Summary\n\nFixing the issue of KQL query bar
edit component not showing properly\nlong multiline KQL queries.\n\nThe
query now isn't fully visible, and it's not possible to navigate\nwith
Up/Down keyboard keys. It's also not possible to scroll down, as\nthe
component doesn't allow to insert new line symbols.\n\nI am fixing the
behavior by:\n- setting the `bubbleSubmitEvent={true}` so that the key
press can\npropagate to higher components and be served properly. This
fixes the\nproblem of not allowing to enter new lines.\n- I am not
touching the broken behavior of Up/Down arrow keys, which\nintercepts
the event and instead of moving the cursor, iterates items in\nthe
Suggestions panel, which is counterintuitive. Separate issue will
be\ncreated for the Kibana Visualization team.\n- I am modifying one css
style in Kibana Visualization to set height to\nand adding a class to
set proper alignment of buttons.\n\n# BEFORE\n- Not possible to insert
new lines. \n- Arrow DOWN takes focus to Suggestions Panel, then
together with Arrow\nUP it is used to iterate the suggestions\n- When
textarea grows it gets hidden below the parent's
panel\n\n\nhttps://github.com/user-attachments/assets/d97b81e3-7409-4089-865d-89ee702744f9\n\n#
AFTER \n- Possible to insert new lines\n- Behavior of DOWN / UP Arrows
stays the same \n- When textarea grows the whole panel
resizes\n\n\n\nhttps://github.com/user-attachments/assets/3a59923b-0fb1-49e7-b11d-55474f465ca2\n\n\nhttps://github.com/user-attachments/assets/48efd325-1c66-43ca-9936-69ef37b4ee7a","sha":"8159319d75a3563228378a54492cb27919efea18","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","v9.0.0","Team:Detections
and Resp","Team: SecuritySolution","Team:Detection Rule
Management","Feature:Prebuilt Detection
Rules","backport:version","v8.18.0","v9.1.0","v8.19.0"],"title":"[Security
Solution] Fix editing in KQL Query
Bar","number":208212,"url":"https://github.com/elastic/kibana/pull/208212","mergeCommit":{"message":"[Security
Solution] Fix editing in KQL Query Bar (#208212)\n\n**Partially
resolves: #203523**\n\n## Summary\n\nFixing the issue of KQL query bar
edit component not showing properly\nlong multiline KQL queries.\n\nThe
query now isn't fully visible, and it's not possible to navigate\nwith
Up/Down keyboard keys. It's also not possible to scroll down, as\nthe
component doesn't allow to insert new line symbols.\n\nI am fixing the
behavior by:\n- setting the `bubbleSubmitEvent={true}` so that the key
press can\npropagate to higher components and be served properly. This
fixes the\nproblem of not allowing to enter new lines.\n- I am not
touching the broken behavior of Up/Down arrow keys, which\nintercepts
the event and instead of moving the cursor, iterates items in\nthe
Suggestions panel, which is counterintuitive. Separate issue will
be\ncreated for the Kibana Visualization team.\n- I am modifying one css
style in Kibana Visualization to set height to\nand adding a class to
set proper alignment of buttons.\n\n# BEFORE\n- Not possible to insert
new lines. \n- Arrow DOWN takes focus to Suggestions Panel, then
together with Arrow\nUP it is used to iterate the suggestions\n- When
textarea grows it gets hidden below the parent's
panel\n\n\nhttps://github.com/user-attachments/assets/d97b81e3-7409-4089-865d-89ee702744f9\n\n#
AFTER \n- Possible to insert new lines\n- Behavior of DOWN / UP Arrows
stays the same \n- When textarea grows the whole panel
resizes\n\n\n\nhttps://github.com/user-attachments/assets/3a59923b-0fb1-49e7-b11d-55474f465ca2\n\n\nhttps://github.com/user-attachments/assets/48efd325-1c66-43ca-9936-69ef37b4ee7a","sha":"8159319d75a3563228378a54492cb27919efea18"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.18","8.x"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/208212","number":208212,"mergeCommit":{"message":"[Security
Solution] Fix editing in KQL Query Bar (#208212)\n\n**Partially
resolves: #203523**\n\n## Summary\n\nFixing the issue of KQL query bar
edit component not showing properly\nlong multiline KQL queries.\n\nThe
query now isn't fully visible, and it's not possible to navigate\nwith
Up/Down keyboard keys. It's also not possible to scroll down, as\nthe
component doesn't allow to insert new line symbols.\n\nI am fixing the
behavior by:\n- setting the `bubbleSubmitEvent={true}` so that the key
press can\npropagate to higher components and be served properly. This
fixes the\nproblem of not allowing to enter new lines.\n- I am not
touching the broken behavior of Up/Down arrow keys, which\nintercepts
the event and instead of moving the cursor, iterates items in\nthe
Suggestions panel, which is counterintuitive. Separate issue will
be\ncreated for the Kibana Visualization team.\n- I am modifying one css
style in Kibana Visualization to set height to\nand adding a class to
set proper alignment of buttons.\n\n# BEFORE\n- Not possible to insert
new lines. \n- Arrow DOWN takes focus to Suggestions Panel, then
together with Arrow\nUP it is used to iterate the suggestions\n- When
textarea grows it gets hidden below the parent's
panel\n\n\nhttps://github.com/user-attachments/assets/d97b81e3-7409-4089-865d-89ee702744f9\n\n#
AFTER \n- Possible to insert new lines\n- Behavior of DOWN / UP Arrows
stays the same \n- When textarea grows the whole panel
resizes\n\n\n\nhttps://github.com/user-attachments/assets/3a59923b-0fb1-49e7-b11d-55474f465ca2\n\n\nhttps://github.com/user-attachments/assets/48efd325-1c66-43ca-9936-69ef37b4ee7a","sha":"8159319d75a3563228378a54492cb27919efea18"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Jacek Kolezynski <[email protected]>
kibanamachine added a commit that referenced this pull request Feb 19, 2025
…1804)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Security Solution] Fix editing in KQL Query Bar
(#208212)](#208212)

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

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

<!--BACKPORT [{"author":{"name":"Jacek
Kolezynski","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-02-19T15:43:10Z","message":"[Security
Solution] Fix editing in KQL Query Bar (#208212)\n\n**Partially
resolves: #203523**\n\n## Summary\n\nFixing the issue of KQL query bar
edit component not showing properly\nlong multiline KQL queries.\n\nThe
query now isn't fully visible, and it's not possible to navigate\nwith
Up/Down keyboard keys. It's also not possible to scroll down, as\nthe
component doesn't allow to insert new line symbols.\n\nI am fixing the
behavior by:\n- setting the `bubbleSubmitEvent={true}` so that the key
press can\npropagate to higher components and be served properly. This
fixes the\nproblem of not allowing to enter new lines.\n- I am not
touching the broken behavior of Up/Down arrow keys, which\nintercepts
the event and instead of moving the cursor, iterates items in\nthe
Suggestions panel, which is counterintuitive. Separate issue will
be\ncreated for the Kibana Visualization team.\n- I am modifying one css
style in Kibana Visualization to set height to\nand adding a class to
set proper alignment of buttons.\n\n# BEFORE\n- Not possible to insert
new lines. \n- Arrow DOWN takes focus to Suggestions Panel, then
together with Arrow\nUP it is used to iterate the suggestions\n- When
textarea grows it gets hidden below the parent's
panel\n\n\nhttps://github.com/user-attachments/assets/d97b81e3-7409-4089-865d-89ee702744f9\n\n#
AFTER \n- Possible to insert new lines\n- Behavior of DOWN / UP Arrows
stays the same \n- When textarea grows the whole panel
resizes\n\n\n\nhttps://github.com/user-attachments/assets/3a59923b-0fb1-49e7-b11d-55474f465ca2\n\n\nhttps://github.com/user-attachments/assets/48efd325-1c66-43ca-9936-69ef37b4ee7a","sha":"8159319d75a3563228378a54492cb27919efea18","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","v9.0.0","Team:Detections
and Resp","Team: SecuritySolution","Team:Detection Rule
Management","Feature:Prebuilt Detection
Rules","backport:version","v8.18.0","v9.1.0","v8.19.0"],"title":"[Security
Solution] Fix editing in KQL Query
Bar","number":208212,"url":"https://github.com/elastic/kibana/pull/208212","mergeCommit":{"message":"[Security
Solution] Fix editing in KQL Query Bar (#208212)\n\n**Partially
resolves: #203523**\n\n## Summary\n\nFixing the issue of KQL query bar
edit component not showing properly\nlong multiline KQL queries.\n\nThe
query now isn't fully visible, and it's not possible to navigate\nwith
Up/Down keyboard keys. It's also not possible to scroll down, as\nthe
component doesn't allow to insert new line symbols.\n\nI am fixing the
behavior by:\n- setting the `bubbleSubmitEvent={true}` so that the key
press can\npropagate to higher components and be served properly. This
fixes the\nproblem of not allowing to enter new lines.\n- I am not
touching the broken behavior of Up/Down arrow keys, which\nintercepts
the event and instead of moving the cursor, iterates items in\nthe
Suggestions panel, which is counterintuitive. Separate issue will
be\ncreated for the Kibana Visualization team.\n- I am modifying one css
style in Kibana Visualization to set height to\nand adding a class to
set proper alignment of buttons.\n\n# BEFORE\n- Not possible to insert
new lines. \n- Arrow DOWN takes focus to Suggestions Panel, then
together with Arrow\nUP it is used to iterate the suggestions\n- When
textarea grows it gets hidden below the parent's
panel\n\n\nhttps://github.com/user-attachments/assets/d97b81e3-7409-4089-865d-89ee702744f9\n\n#
AFTER \n- Possible to insert new lines\n- Behavior of DOWN / UP Arrows
stays the same \n- When textarea grows the whole panel
resizes\n\n\n\nhttps://github.com/user-attachments/assets/3a59923b-0fb1-49e7-b11d-55474f465ca2\n\n\nhttps://github.com/user-attachments/assets/48efd325-1c66-43ca-9936-69ef37b4ee7a","sha":"8159319d75a3563228378a54492cb27919efea18"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.18","8.x"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/208212","number":208212,"mergeCommit":{"message":"[Security
Solution] Fix editing in KQL Query Bar (#208212)\n\n**Partially
resolves: #203523**\n\n## Summary\n\nFixing the issue of KQL query bar
edit component not showing properly\nlong multiline KQL queries.\n\nThe
query now isn't fully visible, and it's not possible to navigate\nwith
Up/Down keyboard keys. It's also not possible to scroll down, as\nthe
component doesn't allow to insert new line symbols.\n\nI am fixing the
behavior by:\n- setting the `bubbleSubmitEvent={true}` so that the key
press can\npropagate to higher components and be served properly. This
fixes the\nproblem of not allowing to enter new lines.\n- I am not
touching the broken behavior of Up/Down arrow keys, which\nintercepts
the event and instead of moving the cursor, iterates items in\nthe
Suggestions panel, which is counterintuitive. Separate issue will
be\ncreated for the Kibana Visualization team.\n- I am modifying one css
style in Kibana Visualization to set height to\nand adding a class to
set proper alignment of buttons.\n\n# BEFORE\n- Not possible to insert
new lines. \n- Arrow DOWN takes focus to Suggestions Panel, then
together with Arrow\nUP it is used to iterate the suggestions\n- When
textarea grows it gets hidden below the parent's
panel\n\n\nhttps://github.com/user-attachments/assets/d97b81e3-7409-4089-865d-89ee702744f9\n\n#
AFTER \n- Possible to insert new lines\n- Behavior of DOWN / UP Arrows
stays the same \n- When textarea grows the whole panel
resizes\n\n\n\nhttps://github.com/user-attachments/assets/3a59923b-0fb1-49e7-b11d-55474f465ca2\n\n\nhttps://github.com/user-attachments/assets/48efd325-1c66-43ca-9936-69ef37b4ee7a","sha":"8159319d75a3563228378a54492cb27919efea18"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Jacek Kolezynski <[email protected]>
kibanamachine added a commit that referenced this pull request Feb 19, 2025
…11803)

# Backport

This will backport the following commits from `main` to `8.18`:
- [[Security Solution] Fix editing in KQL Query Bar
(#208212)](#208212)

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

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

<!--BACKPORT [{"author":{"name":"Jacek
Kolezynski","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-02-19T15:43:10Z","message":"[Security
Solution] Fix editing in KQL Query Bar (#208212)\n\n**Partially
resolves: #203523**\n\n## Summary\n\nFixing the issue of KQL query bar
edit component not showing properly\nlong multiline KQL queries.\n\nThe
query now isn't fully visible, and it's not possible to navigate\nwith
Up/Down keyboard keys. It's also not possible to scroll down, as\nthe
component doesn't allow to insert new line symbols.\n\nI am fixing the
behavior by:\n- setting the `bubbleSubmitEvent={true}` so that the key
press can\npropagate to higher components and be served properly. This
fixes the\nproblem of not allowing to enter new lines.\n- I am not
touching the broken behavior of Up/Down arrow keys, which\nintercepts
the event and instead of moving the cursor, iterates items in\nthe
Suggestions panel, which is counterintuitive. Separate issue will
be\ncreated for the Kibana Visualization team.\n- I am modifying one css
style in Kibana Visualization to set height to\nand adding a class to
set proper alignment of buttons.\n\n# BEFORE\n- Not possible to insert
new lines. \n- Arrow DOWN takes focus to Suggestions Panel, then
together with Arrow\nUP it is used to iterate the suggestions\n- When
textarea grows it gets hidden below the parent's
panel\n\n\nhttps://github.com/user-attachments/assets/d97b81e3-7409-4089-865d-89ee702744f9\n\n#
AFTER \n- Possible to insert new lines\n- Behavior of DOWN / UP Arrows
stays the same \n- When textarea grows the whole panel
resizes\n\n\n\nhttps://github.com/user-attachments/assets/3a59923b-0fb1-49e7-b11d-55474f465ca2\n\n\nhttps://github.com/user-attachments/assets/48efd325-1c66-43ca-9936-69ef37b4ee7a","sha":"8159319d75a3563228378a54492cb27919efea18","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","v9.0.0","Team:Detections
and Resp","Team: SecuritySolution","Team:Detection Rule
Management","Feature:Prebuilt Detection
Rules","backport:version","v8.18.0","v9.1.0","v8.19.0"],"title":"[Security
Solution] Fix editing in KQL Query
Bar","number":208212,"url":"https://github.com/elastic/kibana/pull/208212","mergeCommit":{"message":"[Security
Solution] Fix editing in KQL Query Bar (#208212)\n\n**Partially
resolves: #203523**\n\n## Summary\n\nFixing the issue of KQL query bar
edit component not showing properly\nlong multiline KQL queries.\n\nThe
query now isn't fully visible, and it's not possible to navigate\nwith
Up/Down keyboard keys. It's also not possible to scroll down, as\nthe
component doesn't allow to insert new line symbols.\n\nI am fixing the
behavior by:\n- setting the `bubbleSubmitEvent={true}` so that the key
press can\npropagate to higher components and be served properly. This
fixes the\nproblem of not allowing to enter new lines.\n- I am not
touching the broken behavior of Up/Down arrow keys, which\nintercepts
the event and instead of moving the cursor, iterates items in\nthe
Suggestions panel, which is counterintuitive. Separate issue will
be\ncreated for the Kibana Visualization team.\n- I am modifying one css
style in Kibana Visualization to set height to\nand adding a class to
set proper alignment of buttons.\n\n# BEFORE\n- Not possible to insert
new lines. \n- Arrow DOWN takes focus to Suggestions Panel, then
together with Arrow\nUP it is used to iterate the suggestions\n- When
textarea grows it gets hidden below the parent's
panel\n\n\nhttps://github.com/user-attachments/assets/d97b81e3-7409-4089-865d-89ee702744f9\n\n#
AFTER \n- Possible to insert new lines\n- Behavior of DOWN / UP Arrows
stays the same \n- When textarea grows the whole panel
resizes\n\n\n\nhttps://github.com/user-attachments/assets/3a59923b-0fb1-49e7-b11d-55474f465ca2\n\n\nhttps://github.com/user-attachments/assets/48efd325-1c66-43ca-9936-69ef37b4ee7a","sha":"8159319d75a3563228378a54492cb27919efea18"}},"sourceBranch":"main","suggestedTargetBranches":["9.0","8.18","8.x"],"targetPullRequestStates":[{"branch":"9.0","label":"v9.0.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/208212","number":208212,"mergeCommit":{"message":"[Security
Solution] Fix editing in KQL Query Bar (#208212)\n\n**Partially
resolves: #203523**\n\n## Summary\n\nFixing the issue of KQL query bar
edit component not showing properly\nlong multiline KQL queries.\n\nThe
query now isn't fully visible, and it's not possible to navigate\nwith
Up/Down keyboard keys. It's also not possible to scroll down, as\nthe
component doesn't allow to insert new line symbols.\n\nI am fixing the
behavior by:\n- setting the `bubbleSubmitEvent={true}` so that the key
press can\npropagate to higher components and be served properly. This
fixes the\nproblem of not allowing to enter new lines.\n- I am not
touching the broken behavior of Up/Down arrow keys, which\nintercepts
the event and instead of moving the cursor, iterates items in\nthe
Suggestions panel, which is counterintuitive. Separate issue will
be\ncreated for the Kibana Visualization team.\n- I am modifying one css
style in Kibana Visualization to set height to\nand adding a class to
set proper alignment of buttons.\n\n# BEFORE\n- Not possible to insert
new lines. \n- Arrow DOWN takes focus to Suggestions Panel, then
together with Arrow\nUP it is used to iterate the suggestions\n- When
textarea grows it gets hidden below the parent's
panel\n\n\nhttps://github.com/user-attachments/assets/d97b81e3-7409-4089-865d-89ee702744f9\n\n#
AFTER \n- Possible to insert new lines\n- Behavior of DOWN / UP Arrows
stays the same \n- When textarea grows the whole panel
resizes\n\n\n\nhttps://github.com/user-attachments/assets/3a59923b-0fb1-49e7-b11d-55474f465ca2\n\n\nhttps://github.com/user-attachments/assets/48efd325-1c66-43ca-9936-69ef37b4ee7a","sha":"8159319d75a3563228378a54492cb27919efea18"}},{"branch":"8.x","label":"v8.19.0","branchLabelMappingKey":"^v8.19.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Jacek Kolezynski <[email protected]>
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 bug Fixes for quality problems that affect the customer experience Feature:Prebuilt Detection Rules Security Solution Prebuilt Detection Rules area release_note:skip Skip the PR/issue when compiling release notes Team:Detection Rule Management Security Detection Rule Management Team Team:Detections and Resp Security Detection Response Team Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. v8.18.0 v8.19.0 v9.0.0 v9.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Security Solution] KQL query isn't visible in edit mode