-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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] Handle editor resize #180494
[Console Monaco Migration] Handle editor resize #180494
Conversation
/ci |
/ci |
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 for working on this, @ElenaStoeva!
As discussed, I had a look at your solution and I was wondering if you have tried using automaticLayout: true
mentioned in this StackOverflow question? Could you please check if that could work for our use case? If not, we can use editor.layout
but maybe we could put the code for both input and output editors in a reusable function? Also for both solutions, we need to check for performance: for example, add debounce
for editor.layout
calls, as it is implemented right now, it's being called many times while the user is still resizing the window.
Thanks for the review @yuliacech! Yes, I tried using this option alone but it didn't work well - as the resizer is being moved, it bounces back and forth: Screen.Recording.2024-04-16.at.10.43.28.movI played around using the |
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 for the explanation, @ElenaStoeva! The resizer works as expected 👍
Pinging @elastic/kibana-management (Team:Kibana Management) |
/ci |
divElement: HTMLDivElement, | ||
editor: monaco.editor.IStandaloneCodeEditor | ||
) => { | ||
resizeChecker.current = new ResizeChecker(divElement); |
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.
suggest to check if there is already a resizeChecker.current and destroy it if there is one
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.
💚 Build Succeeded
Metrics [docs]Module Count
Public APIs missing comments
Async chunks
History
To update your PR or re-run it, just comment with: cc @ElenaStoeva |
Closes elastic#180216 ## Summary This PR adds resize handling for the editor and the output panel in Console Monaco. https://github.com/elastic/kibana/assets/59341489/983f0613-5f73-4441-b821-ec789b782984
Closes #180216
Summary
This PR adds resize handling for the editor and the output panel in Console Monaco.
Screen.Recording.2024-04-10.at.16.49.18.mov