Skip to content
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

Call revealLastElement within runAtThisOrScheduleAtNextAnimationFrame in repl #75043

Merged
merged 1 commit into from
Jun 10, 2019

Conversation

jeanp413
Copy link
Contributor

@jeanp413 jeanp413 commented Jun 7, 2019

Fixes #70331

@isidorn
Copy link
Contributor

isidorn commented Jun 7, 2019

Thanks for providing the PR. Added comments in the code

src/vs/workbench/contrib/debug/browser/repl.ts Outdated Show resolved Hide resolved
const treeHeight = dimension.height - this.replInputHeight;
this.tree.getHTMLElement().style.height = `${treeHeight}px`;
this.tree.layout(treeHeight, dimension.width);
if (lastElementVisible) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I do not really like this call here.
When the repl gets layouted if the last element is visible we should reveal it?
Why should we reveal it if it is already visible?
Also on layout seems like a wrong place to call this. Layout happens every time the dimensions of the repl change and on the first render.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I put that extra call to reveal the last element when the inputbox gets resized because otherwise it would be covered. Also when resizing the windows.
console

src/vs/workbench/contrib/debug/browser/repl.ts Outdated Show resolved Hide resolved
@isidorn
Copy link
Contributor

isidorn commented Jun 7, 2019

I think this approach is not good, bottom line it just calls reveal more often and with a timeout.
I believe the actual issue is in the provisional measuring of the height of the repl element.
https://github.com/Microsoft/vscode/blob/5ef80a9acde66c587a1de57a0868ac5cd24e6f1b/src/vs/workbench/contrib/debug/browser/repl.ts#L749

Note the height strategy we use with the tree which the repl uses. Repl gives the provisional height of each element so the tree would get an idea of the scroll size, and once the elments are in the dom the tree measuers them actually and adjusts.
So I think the provisional height computation should be improved and that is the root cause of this issue.

Thanks again for jumping on this issue!

@jeanp413
Copy link
Contributor Author

Updated the PR with a better approximation for provisional height

@isidorn
Copy link
Contributor

isidorn commented Jun 10, 2019

Great work, merging in.
Thanks a lot!

@isidorn isidorn merged commit f3ea637 into microsoft:master Jun 10, 2019
@isidorn isidorn added this to the June 2019 milestone Jun 10, 2019
@jeanp413 jeanp413 deleted the fix-70331 branch July 5, 2019 02:59
@github-actions github-actions bot locked and limited conversation to collaborators Mar 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Debug console scrolls near top after each evaluated line after exception raised in debug console
2 participants