Add outline.collapseItems and fix outlines collapsing unexpectedly (#53262)#158650
Conversation
|
@jrieken please consider merging this in time for next week's endgame start. |
| tree.dispose(); | ||
| this._tree = undefined; | ||
| })); | ||
| this._disposables.add(this._tree.onDidChangeCollapseState(() => this._updateAllCollapsedContext())); |
There was a problem hiding this comment.
This will leak because listeners are piling up in the object disposable store, not the session store...
There was a problem hiding this comment.
Thanks for fixing this.
jrieken
left a comment
There was a problem hiding this comment.
Thanks. This is looking pretty good. I have pushed a small tweak to prevent listeners piling up and added an extra ctx update that's needed when switching between editors.
Before we merge: can we find a better name for the setting? IMO it should mention expand or collapse
How about Or conversely Between those two I slightly prefer the first because it aligns with the default (existing) behaviour (initially expanded). |
|
I prefer the naming of the former but the latter is a more similar case - because it isn't about an interaction model but default expand/collapse state. How about |
I like this. Will you make the changes, or do you want me to? |
As you like. I won't be able to do it today but could tackle it tomorrow |
|
Please do it. I am out of time today, then basically OOO for nearly 2 weeks. |
outline.initialState and fix outlines collapsing unexpectedly (#53262)outline.collapseItems and fix outlines collapsing unexpectedly (#53262)
This PR implements #53262, adding a setting
outline.initialStatewith valuescollapsedandexpanded(the default).I used an enumeration rather than a boolean so it can be extended in the future if required.
The 'Collapse All' button now becomes 'Expand All' when tree is fully collapsed.
I also resolved a bug that was causing outlines to collapse unexpectedly after switching several times between files. To reproduce the bug: