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

Fix explorer item creation and disposal #79383

Merged
merged 3 commits into from
Sep 10, 2019

Conversation

jeanp413
Copy link
Contributor

This PR reapplies the changes from #72627 and the improvements from here and here.
Adittionaly has some changes to fix #78153 reported issues

@@ -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) {
Copy link
Contributor Author

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)

Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Opened #79540 and it's corresponding PR #79542

@isidorn isidorn self-assigned this Aug 19, 2019
@isidorn isidorn added this to the August 2019 milestone Aug 19, 2019
@@ -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) {
Copy link
Contributor

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();
Copy link
Contributor

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.

Copy link
Contributor Author

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)

@isidorn
Copy link
Contributor

isidorn commented Aug 20, 2019

@jeanp413 thanks a lot for your PR.
I have added some comments inline, can you please address them?

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).
I tried it out quickly and seems to work well (but plan to test it more once we adress the things I mentioned in the review).

@jeanp413 jeanp413 force-pushed the fix-explorer-edit-item branch from a7e7cd1 to 8e86e73 Compare August 21, 2019 01:47
@jeanp413
Copy link
Contributor Author

I tested it for the bugs reported in #72626, #75693. #75624, #78153
Did you find a corner case that's not covered?

@isidorn
Copy link
Contributor

isidorn commented Aug 21, 2019

@jeanp413 thanks for the PR and for updating it.
However for now I have decided to go with the current approach. And we can change this next milestone after we get some feedback, thus assigning it to september. The current limitations of the approach are dangling input elements and the input box not closing on scroll. For now I can live with that.

@isidorn
Copy link
Contributor

isidorn commented Sep 10, 2019

I have tested this now more. Seems to work fine and looks good. Let's merge it in to get feedback from insiders users.
Thanks a lot for this PR.

@isidorn isidorn merged commit af53133 into microsoft:master Sep 10, 2019
@jeanp413 jeanp413 deleted the fix-explorer-edit-item branch September 10, 2019 15:54
@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
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Explorer: Can't create folder on newly created folder
2 participants