Skip to content

[Console] Fix autoselecting last request#218001

Merged
ElenaStoeva merged 2 commits intoelastic:mainfrom
ElenaStoeva:console/fix-autoselecting-last-request
May 9, 2025
Merged

[Console] Fix autoselecting last request#218001
ElenaStoeva merged 2 commits intoelastic:mainfrom
ElenaStoeva:console/fix-autoselecting-last-request

Conversation

@ElenaStoeva
Copy link
Contributor

@ElenaStoeva ElenaStoeva commented Apr 11, 2025

Fixes #194257

Summary

This PR fixes the bug in Console where, if there is a request on the last line of the editor, it gets automatically selected when the editor is open. This is because the cursor is initially placed at the last position of the edition, and if this position turn out to be at the end of the request, the request is selected because the editor is on focus. We fix this by not focusing the editor initially (i.e. there is no blinking cursor when you open the editor) - this ensures that there won't be any initial request highlighting as per the logic on the following line:

)

Screen.Recording.2025-04-11.at.16.19.55.mov

@ElenaStoeva ElenaStoeva added Feature:Console Dev Tools Console Feature Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more t// release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting v9.1.0 v8.19.0 labels Apr 11, 2025
@ElenaStoeva ElenaStoeva self-assigned this Apr 11, 2025
@ElenaStoeva ElenaStoeva requested a review from a team as a code owner April 11, 2025 15:22
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-management (Team:Kibana Management)

Copy link
Member

@sabarasaba sabarasaba left a comment

Choose a reason for hiding this comment

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

works well, seems like an ok tradeoff for getting this fixed. Nice job!

@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #95 / Cloud Security Posture Vulnerabilities Page - DataTable "before all" hook in "Vulnerabilities Page - DataTable"
  • [job] [logs] Jest Tests #13 / create modal should prevent submission if there is a duplicate name error (managed)
  • [job] [logs] Jest Tests #13 / create modal should prevent submission if there is a duplicate name error (unmanaged)
  • [job] [logs] Jest Tests #13 / getNextRunAt should use the rrule with a fixed time when it is given to calculate the next runAt

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
console 185.8KB 185.7KB -20.0B

History

cc @ElenaStoeva

@ElenaStoeva ElenaStoeva merged commit 7be65de into elastic:main May 9, 2025
9 checks passed
kdelemme pushed a commit to kdelemme/kibana that referenced this pull request May 9, 2025
Fixes elastic#194257

## Summary


This PR fixes the bug in Console where, if there is a request on the
last line of the editor, it gets automatically selected when the editor
is open. This is because the cursor is initially placed at the last
position of the edition, and if this position turn out to be at the end
of the request, the request is selected because the editor is on focus.
We fix this by not focusing the editor initially (i.e. there is no
blinking cursor when you open the editor) - this ensures that there
won't be any initial request highlighting as per the logic on the
following line:
https://github.com/elastic/kibana/blob/5c78ff18484e77b5ec5a4ba2ab341ed65db4f21c/src/platform/plugins/shared/console/public/application/containers/editor/monaco_editor_actions_provider.ts#L73)




https://github.com/user-attachments/assets/6f10e59b-92c7-4501-bf01-54987bc2f289
akowalska622 pushed a commit to akowalska622/kibana that referenced this pull request May 29, 2025
Fixes elastic#194257

## Summary


This PR fixes the bug in Console where, if there is a request on the
last line of the editor, it gets automatically selected when the editor
is open. This is because the cursor is initially placed at the last
position of the edition, and if this position turn out to be at the end
of the request, the request is selected because the editor is on focus.
We fix this by not focusing the editor initially (i.e. there is no
blinking cursor when you open the editor) - this ensures that there
won't be any initial request highlighting as per the logic on the
following line:
https://github.com/elastic/kibana/blob/5c78ff18484e77b5ec5a4ba2ab341ed65db4f21c/src/platform/plugins/shared/console/public/application/containers/editor/monaco_editor_actions_provider.ts#L73)




https://github.com/user-attachments/assets/6f10e59b-92c7-4501-bf01-54987bc2f289
qn895 pushed a commit to qn895/kibana that referenced this pull request Jun 3, 2025
Fixes elastic#194257

## Summary


This PR fixes the bug in Console where, if there is a request on the
last line of the editor, it gets automatically selected when the editor
is open. This is because the cursor is initially placed at the last
position of the edition, and if this position turn out to be at the end
of the request, the request is selected because the editor is on focus.
We fix this by not focusing the editor initially (i.e. there is no
blinking cursor when you open the editor) - this ensures that there
won't be any initial request highlighting as per the logic on the
following line:
https://github.com/elastic/kibana/blob/5c78ff18484e77b5ec5a4ba2ab341ed65db4f21c/src/platform/plugins/shared/console/public/application/containers/editor/monaco_editor_actions_provider.ts#L73)




https://github.com/user-attachments/assets/6f10e59b-92c7-4501-bf01-54987bc2f289
@ElenaStoeva ElenaStoeva deleted the console/fix-autoselecting-last-request branch January 31, 2026 19:51
@ElenaStoeva ElenaStoeva added backport:version Backport to applied version labels and removed backport:skip This PR does not require backporting labels Feb 26, 2026
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.19, 9.1

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

@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.19, 9.1

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

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Feb 26, 2026
Fixes elastic#194257

## Summary

This PR fixes the bug in Console where, if there is a request on the
last line of the editor, it gets automatically selected when the editor
is open. This is because the cursor is initially placed at the last
position of the edition, and if this position turn out to be at the end
of the request, the request is selected because the editor is on focus.
We fix this by not focusing the editor initially (i.e. there is no
blinking cursor when you open the editor) - this ensures that there
won't be any initial request highlighting as per the logic on the
following line:
https://github.com/elastic/kibana/blob/5c78ff18484e77b5ec5a4ba2ab341ed65db4f21c/src/platform/plugins/shared/console/public/application/containers/editor/monaco_editor_actions_provider.ts#L73)

https://github.com/user-attachments/assets/6f10e59b-92c7-4501-bf01-54987bc2f289
(cherry picked from commit 7be65de)
@kibanamachine
Copy link
Contributor

💔 Some backports could not be created

Status Branch Result
8.19
9.1 Cherrypick failed because the selected commit (7be65de) is empty. Did you already backport this commit?

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

Manual backport

To create the backport manually run:

node scripts/backport --pr 218001

Questions ?

Please refer to the Backport tool documentation

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Feb 26, 2026
Fixes elastic#194257

## Summary

This PR fixes the bug in Console where, if there is a request on the
last line of the editor, it gets automatically selected when the editor
is open. This is because the cursor is initially placed at the last
position of the edition, and if this position turn out to be at the end
of the request, the request is selected because the editor is on focus.
We fix this by not focusing the editor initially (i.e. there is no
blinking cursor when you open the editor) - this ensures that there
won't be any initial request highlighting as per the logic on the
following line:
https://github.com/elastic/kibana/blob/5c78ff18484e77b5ec5a4ba2ab341ed65db4f21c/src/platform/plugins/shared/console/public/application/containers/editor/monaco_editor_actions_provider.ts#L73)

https://github.com/user-attachments/assets/6f10e59b-92c7-4501-bf01-54987bc2f289
(cherry picked from commit 7be65de)
@kibanamachine
Copy link
Contributor

💔 Some backports could not be created

Status Branch Result
8.19
9.1 Cherrypick failed because the selected commit (7be65de) is empty. Did you already backport this commit?

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

Manual backport

To create the backport manually run:

node scripts/backport --pr 218001

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Feb 26, 2026
# Backport

This will backport the following commits from `main` to `8.19`:
- [[Console] Fix autoselecting last request
(#218001)](#218001)

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

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

<!--BACKPORT [{"author":{"name":"Elena
Stoeva","email":"59341489+ElenaStoeva@users.noreply.github.com"},"sourceCommit":{"committedDate":"2025-05-09T12:51:30Z","message":"[Console]
Fix autoselecting last request (#218001)\n\nFixes
https://github.com/elastic/kibana/issues/194257\n\n## Summary\n\n\nThis
PR fixes the bug in Console where, if there is a request on the\nlast
line of the editor, it gets automatically selected when the editor\nis
open. This is because the cursor is initially placed at the
last\nposition of the edition, and if this position turn out to be at
the end\nof the request, the request is selected because the editor is
on focus.\nWe fix this by not focusing the editor initially (i.e. there
is no\nblinking cursor when you open the editor) - this ensures that
there\nwon't be any initial request highlighting as per the logic on
the\nfollowing
line:\nhttps://github.com/elastic/kibana/blob/5c78ff18484e77b5ec5a4ba2ab341ed65db4f21c/src/platform/plugins/shared/console/public/application/containers/editor/monaco_editor_actions_provider.ts#L73)\n\n\n\n\nhttps://github.com/user-attachments/assets/6f10e59b-92c7-4501-bf01-54987bc2f289","sha":"7be65de507d828f508348f7f7b7ad5e1476833f5","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Console","Team:Kibana
Management","release_note:skip","backport:version","v9.1.0","v8.19.0","v9.4.0"],"title":"[Console]
Fix autoselecting last
request","number":218001,"url":"https://github.com/elastic/kibana/pull/218001","mergeCommit":{"message":"[Console]
Fix autoselecting last request (#218001)\n\nFixes
https://github.com/elastic/kibana/issues/194257\n\n## Summary\n\n\nThis
PR fixes the bug in Console where, if there is a request on the\nlast
line of the editor, it gets automatically selected when the editor\nis
open. This is because the cursor is initially placed at the
last\nposition of the edition, and if this position turn out to be at
the end\nof the request, the request is selected because the editor is
on focus.\nWe fix this by not focusing the editor initially (i.e. there
is no\nblinking cursor when you open the editor) - this ensures that
there\nwon't be any initial request highlighting as per the logic on
the\nfollowing
line:\nhttps://github.com/elastic/kibana/blob/5c78ff18484e77b5ec5a4ba2ab341ed65db4f21c/src/platform/plugins/shared/console/public/application/containers/editor/monaco_editor_actions_provider.ts#L73)\n\n\n\n\nhttps://github.com/user-attachments/assets/6f10e59b-92c7-4501-bf01-54987bc2f289","sha":"7be65de507d828f508348f7f7b7ad5e1476833f5"}},"sourceBranch":"main","suggestedTargetBranches":["8.19"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/218001","number":218001,"mergeCommit":{"message":"[Console]
Fix autoselecting last request (#218001)\n\nFixes
https://github.com/elastic/kibana/issues/194257\n\n## Summary\n\n\nThis
PR fixes the bug in Console where, if there is a request on the\nlast
line of the editor, it gets automatically selected when the editor\nis
open. This is because the cursor is initially placed at the
last\nposition of the edition, and if this position turn out to be at
the end\nof the request, the request is selected because the editor is
on focus.\nWe fix this by not focusing the editor initially (i.e. there
is no\nblinking cursor when you open the editor) - this ensures that
there\nwon't be any initial request highlighting as per the logic on
the\nfollowing
line:\nhttps://github.com/elastic/kibana/blob/5c78ff18484e77b5ec5a4ba2ab341ed65db4f21c/src/platform/plugins/shared/console/public/application/containers/editor/monaco_editor_actions_provider.ts#L73)\n\n\n\n\nhttps://github.com/user-attachments/assets/6f10e59b-92c7-4501-bf01-54987bc2f289","sha":"7be65de507d828f508348f7f7b7ad5e1476833f5"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.4","label":"v9.4.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Elena Stoeva <59341489+ElenaStoeva@users.noreply.github.com>
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 Feature:Console Dev Tools Console Feature release_note:skip Skip the PR/issue when compiling release notes Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more t// v8.19.0 v8.19.12 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Console] When clearing output and navigating away, last command of the editor is autoselected

4 participants