-
Notifications
You must be signed in to change notification settings - Fork 30.2k
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
Fix explorer item creation and disposal #79383
Conversation
@@ -219,7 +219,7 @@ export class IndexTreeModel<T extends Exclude<any, undefined>, TFilterData = voi | |||
|
|||
const result = this._setListNodeCollapsed(node, listIndex, revealed, collapsed!, recursive || false); | |||
|
|||
if (this.autoExpandSingleChildren && !collapsed! && !recursive) { | |||
if (node !== this.root && this.autoExpandSingleChildren && !collapsed! && !recursive) { |
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.
This fixes the bug from the second gif from #78153 (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.
Can you please put this in a seperate PR. I like this simple change and it is in the tree land so I would love if we merge it in unrelated to this.
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.
Ok
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.
@@ -219,7 +219,7 @@ export class IndexTreeModel<T extends Exclude<any, undefined>, TFilterData = voi | |||
|
|||
const result = this._setListNodeCollapsed(node, listIndex, revealed, collapsed!, recursive || false); | |||
|
|||
if (this.autoExpandSingleChildren && !collapsed! && !recursive) { | |||
if (node !== this.root && this.autoExpandSingleChildren && !collapsed! && !recursive) { |
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.
Can you please put this in a seperate PR. I like this simple change and it is in the tree land so I would love if we merge it in unrelated to this.
@@ -335,6 +343,13 @@ export class ExplorerView extends ViewletPanel { | |||
|
|||
this._register(this.tree.onContextMenu(e => this.onContextMenu(e))); | |||
|
|||
this._register(this.tree.onDidScroll(e => { | |||
let editable = this.explorerService.getEditable(); |
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 not use getEditableData
?
That API is already there and gives you everything you need.
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.
getEditableData
just return the data, I need the stat so I can call this.tree.getRelativeTop(editable.stat)
@jeanp413 thanks a lot for your PR. Also did you intensivly test this out? There are quite some corner cases (as you are probably aware of). And this code is quite delicate (hacky). |
a7e7cd1
to
8e86e73
Compare
@jeanp413 thanks for the PR and for updating it. |
I have tested this now more. Seems to work fine and looks good. Let's merge it in to get feedback from insiders users. |
This PR reapplies the changes from #72627 and the improvements from here and here.
Adittionaly has some changes to fix #78153 reported issues