[Console] Fix autoselecting last request#218001
Conversation
|
Pinging @elastic/kibana-management (Team:Kibana Management) |
sabarasaba
left a comment
There was a problem hiding this comment.
works well, seems like an ok tradeoff for getting this fixed. Nice job!
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Async chunks
History
cc @ElenaStoeva |
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
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
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
|
Starting backport for target branches: 8.19, 9.1 https://github.com/elastic/kibana/actions/runs/22441787987 |
|
Starting backport for target branches: 8.19, 9.1 https://github.com/elastic/kibana/actions/runs/22441788135 |
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)
💔 Some backports could not be created
Note: Successful backport PRs will be merged automatically after passing CI. Manual backportTo create the backport manually run: Questions ?Please refer to the Backport tool documentation |
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)
💔 Some backports could not be created
Note: Successful backport PRs will be merged automatically after passing CI. Manual backportTo create the backport manually run: Questions ?Please refer to the Backport tool documentation |
# 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>
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:
kibana/src/platform/plugins/shared/console/public/application/containers/editor/monaco_editor_actions_provider.ts
Line 73 in 5c78ff1
Screen.Recording.2025-04-11.at.16.19.55.mov