Skip to content

Stop the Settings tree from jittering - #71292

Merged
roblourens merged 1 commit into
masterfrom
joao/fix-68385
Mar 27, 2019
Merged

roblourens merged 1 commit into
masterfrom
joao/fix-68385

Conversation

@joaomoreno

@joaomoreno João Moreno (joaomoreno) commented Mar 27, 2019 •

Copy link
Copy Markdown
Contributor

roblourens It's tough to fix #68385 automagically, because you're effectively replacing the whole model all the time. But check out this idea:

If your virtual delegate would get called back with the actual measured height, it could start caching them for future getHeight calls. For the cache, we can use WeakMap, making sure we keep its size in check. This is what this PR implements, which seems to work great. What do you think?

I've set this to April in case you think this is too risky. But feel free to move to March if you like it and everything goes well in your testing of it.

@joaomoreno João Moreno (joaomoreno) added the settings-editor VS Code settings editor issues label Mar 27, 2019
@joaomoreno João Moreno (joaomoreno) added this to the April 2019 milestone Mar 27, 2019
@joaomoreno João Moreno (joaomoreno) changed the title fixes #68385 Stop the Settings tree from jittering Mar 27, 2019
@roblourens

roblourens commented Mar 27, 2019 •

Copy link
Copy Markdown
Member

That strategy sounds fine and I'd really like to take it for March so I'll test it today. I don't really understand why what the settings editor does is so strange though. I end up with elements with the same IDs, why does the tree care that the objects are different?

@roblourens roblourens left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This works great, thanks!

@roblourens
roblourens merged commit 9fd249a into master Mar 27, 2019
@roblourens roblourens modified the milestones: April 2019, March 2019 Mar 27, 2019
@joaomoreno

João Moreno (joaomoreno) commented Mar 28, 2019 •

Copy link
Copy Markdown
Contributor Author

That strategy sounds fine and I'd really like to take it for March so I'll test it today. I don't really understand why what the settings editor does is so strange though. I end up with elements with the same IDs, why does the tree care that the objects are different?

Dynamic heights are a list view concept, about two abstraction levels below the tree. As far as the list view is concerned, inserted model elements are always new, even if you delete the same amount (splice(_, N, [...N])).

We could perhaps bring the concept of preserving provisional heights based on the same identity up to the actual list widget, since it already has the notion of a identity provider which could correlate items... but let's do that once the second user comes around. 😉

@joaomoreno
João Moreno (joaomoreno) deleted the joao/fix-68385 branch March 28, 2019 07:09
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

settings-editor VS Code settings editor issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Settings UI Always Scrolls Automatically While Check or Uncheck an Option

2 participants