Skip to content

When filtering a tree don't hide unresolved folders (#66971)#164472

Closed
gjsjohnmurray wants to merge 2 commits intomicrosoft:mainfrom
gjsjohnmurray:fix-66971
Closed

When filtering a tree don't hide unresolved folders (#66971)#164472
gjsjohnmurray wants to merge 2 commits intomicrosoft:mainfrom
gjsjohnmurray:fix-66971

Conversation

@gjsjohnmurray
Copy link
Contributor

This PR addresses #66971. When filtering a tree containing folders whose contents have not yet been fully resolved, retain these folders. This allows the user to expand any whose contents they think might match the filter. If after expanding all nested subfolders there are no matches the folder is excluded from the filtered tree.

Below is an example showing filtering the tree-view-sample Explorer tree for json files without previously having expanded the folders.

Before the change:

junk

After the change:

junk

Observe how the folders remain visible despite their names not matching the filter. Expanding src reveals one matching child. Expanding media results in that folder disappearing because it contains no matching children and no subfolders.

@gjsjohnmurray
Copy link
Contributor Author

/assign @joaomoreno

@lramos15 lramos15 self-assigned this Oct 24, 2022
@lramos15 lramos15 added file-explorer Explorer widget issues under-discussion Issue is under discussion for relevance, priority, approach labels Oct 24, 2022
@lramos15 lramos15 added this to the November 2022 milestone Oct 24, 2022
@lramos15
Copy link
Member

lramos15 commented Oct 24, 2022

Thanks for creating the PR. We will have to discuss this as from a UX perspective I think it's still a bit weird that you clicked media for example and it just dissappears

@gjsjohnmurray
Copy link
Contributor Author

@lramos15 yes, a bit weird and I'll be interested to hear feedback from the UX sync. Perhaps some animation would help (fade, then close up the gap). But I think it's less weird than the current experience of no being able to use tree filtering to locate files in folders you haven't expanded at least once.

@ADTC
Copy link

ADTC commented Oct 24, 2022

Nice job! 100% I hope this gets merged. Honestly the media folder disappearing when opened is a million times better than all folders disappearing when searching. Unless you guys with UX expertise have a better idea, please don't let that stop you from merging.

@joaomoreno
Copy link
Member

joaomoreno commented Oct 25, 2022

I like the simple approach, and I agree with @ADTC: it's better than today even with the sudden disappearance.

I don't think the implementation is correct, though. The situation in which "a node has not yet been resolved" only happens in AsyncDataTree instances. It doesn't make sense to pollute the IndexTreeModel with unnecessary information. The fix should be purely around AsyncDataTree and, possibly, AbstractTree.

@joaomoreno joaomoreno added tree-widget Tree widget issues and removed file-explorer Explorer widget issues labels Oct 25, 2022
@joaomoreno joaomoreno removed this from the November 2022 milestone Oct 25, 2022
gjsjohnmurray added a commit to gjsjohnmurray/vscode that referenced this pull request Nov 23, 2022
@gjsjohnmurray
Copy link
Contributor Author

gjsjohnmurray commented Nov 23, 2022

The fix should be purely around AsyncDataTree and, possibly, AbstractTree.

I just submitted #167047 as an attempt to do this. It works, but a critical line of my change produces two TS compile errors. I need guidance about how to resolve these.

@joaomoreno
Copy link
Member

Closing in favor of #167047

@joaomoreno joaomoreno closed this Jan 2, 2023
@gjsjohnmurray gjsjohnmurray deleted the fix-66971 branch January 2, 2023 16:52
joaomoreno added a commit that referenced this pull request Jan 3, 2023
* Another approach to fixing #66971, after feedback on #164472

* add tree.defaultFindVisibility

Co-authored-by: João Moreno <[email protected]>
@github-actions github-actions bot locked and limited conversation to collaborators Feb 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

tree-widget Tree widget issues under-discussion Issue is under discussion for relevance, priority, approach

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants