Skip to content

Call revealLastElement within runAtThisOrScheduleAtNextAnimationFrame in repl#75043

Merged
isidorn merged 1 commit intomicrosoft:masterfrom
jeanp413:fix-70331
Jun 10, 2019
Merged

Call revealLastElement within runAtThisOrScheduleAtNextAnimationFrame in repl#75043
isidorn merged 1 commit intomicrosoft:masterfrom
jeanp413:fix-70331

Conversation

@jeanp413
Copy link
Contributor

@jeanp413 jeanp413 commented Jun 7, 2019

Fixes #70331

@isidorn
Copy link
Collaborator

isidorn commented Jun 7, 2019

Thanks for providing the PR. Added comments in the code

Copy link
Collaborator

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

@isidorn
Copy link
Collaborator

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
Collaborator

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