-
Notifications
You must be signed in to change notification settings - Fork 37.7k
Fix interactive window to scroll as output resizes #150300
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
Conversation
| [NotebookSetting.interactiveWindowAlwaysScrollOnNewCell]: { | ||
| type: 'boolean', | ||
| default: true, | ||
| markdownDescription: localize('interactiveWindow.alwaysScrollOnNewCell', "Automatically scroll the interactive window to show the output of the last statement executed. If this value is false, the window will only scroll if the last cell was already the one scrolled to.") |
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.
Text for this came from the jupyter extension setting it's replacing.
| class OutputCell { | ||
|
|
||
| public readonly element: HTMLElement; | ||
| public readonly bottomElement: HTMLElement; |
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.
Actually I don't need this change. Leftover from another idea I was trying out. I'll revert it.
rebornix
left a comment
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.
It looks great in overall, only question is if we are duplicating the resize observer, hens not approving yet.
| task.start(); | ||
| task.start(Date.now()); | ||
| task.executionOrder = 1; | ||
| await sleep(10); // Force to be take some time |
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.
Why a timeout is required here? I'm afraid a wait/sleep here can introduce potential flakiness.
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.
Not required, makes the test behave more like a real world execution.
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.
I can remove it, the test will still pass, but I thought it made tests more likely to behave like real world execution - so more like testing the real thing.
| }, 250); | ||
| } | ||
|
|
||
| private trackOutputResize(cellId: string, outputContainer: HTMLElement) { |
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.
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.
No that resize observer is doing something completely different.
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.
And it's on a different element. It doesn't track the container for all of the output.
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.
It might be repurposed to do this as well as what it was already doing though. I could try that and see if it works too
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.
Looks like that works too, please have another look.
This PR fixes #145353
Track output size in the notebook and fire off a debounced message whenever the output resizes
In the IW track this event to force scrolling.