-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[Console Monaco migration] Implement history #183181
Conversation
/ci |
/ci |
/ci |
/ci |
Pinging @elastic/kibana-management (Team:Kibana Management) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this @yuliacech! Tested locally and overall the History functionality works well! I only noticed one issue that occurs when we have two consequent requests and we try to insert one from history before the second request:
Screen.Recording.2024-05-16.at.17.10.26.mov
It seems that the line above the first line of the selected request is separated from the first request and the request from history is put right above it. 🤔
Thanks a lot for your review, @ElenaStoeva! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing job @yuliacech! 🎉 Thanks for fixing the bug and adding unit tests (I will try to use the same mocking technique to add unit tests for the keyboard commands PR)!
After some further testing, I noticed something small, which is not really a bug but just a small difference from the behavior in Ace. Let me know what you think.
Everything else LGTM, so approving the PR to unblock.
prefix = '\n'; | ||
} | ||
} else { | ||
// if not inside a request, insert the request at the cursor position |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I understand, the request from history will always end up at column 1 unless it is not inside a request - then it might end up in the middle of the line if the cursor is there. In Ace editor, it always ends up at column 1. Should we do the same here for consistency?
// if not inside a request, insert the request at the cursor position | |
// the cursor is not inside a request | |
if (!position) { | |
// if no cursor position, insert at the beginning of the first line | |
position = { lineNumber: 1, column: 1 }; | |
} else { | |
// insert the request at the beginning of the line of the cursor position | |
position = { lineNumber: position.lineNumber, column: 1 }; | |
} |
In Ace editor:
Screen.Recording.2024-05-17.at.17.00.22.mov
In this PR:
Screen.Recording.2024-05-17.at.16.58.34.mov
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot, @ElenaStoeva! Another great catch, fixed in 67968c6
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]Module Count
Async chunks
History
To update your PR or re-run it, just comment with: |
Summary
Fixes #182948
This PR migrates history component from ace to monaco and re-implements the logic to insert the saved requests into the monaco editor.
To test:
Screen recording
Screen.Recording.2024-05-15.at.18.37.43.mov