Filter button in search box#8540
Conversation
|
Nice improvements, from a functionality standpoint there are a couple things that feel odd about the filter, but most are outside the scope of this MR. I think the main issue I'm seeing is that after applying the filter to the tree, the up/down actions don't traverse the nodes in an obvious way. For example, if the filter is applied, but a directory is closed then you don't get an automatic expansion when child nodes are highlighted. I've also noticed a strange traversal route when you reach the first child of a parent node, see the GIF below: |
f1cc2d7 to
74871c4
Compare
|
@kenneth-marut-work, thanks for catching that difference in the path traversal. I had missed a reference to the |
74871c4 to
06afd5a
Compare
vince-fugnitto
left a comment
There was a problem hiding this comment.
I'll continue the review tomorrow, likely after we perform the release 👍
vince-fugnitto
left a comment
There was a problem hiding this comment.
The changes work very well ! 👍
It's a very nice improvement to be able to filter down the nodes in the trees:
- verified the
explorer - verified the
outline-view
The scm-view can be improved as when filtering down changes in the view (with the tree mode), we lost the parent changes entry (which has toolbar items).
|
Hmm, good find. I'll see why that parent isn't being preserved like other parents. |
06afd5a to
d365ba7
Compare
|
I had made a silly error that was terminating the traversal of the parent nodes after a single parent was added. I've fixed it, and it appears that the SCM view is working as it should. 🤞 |
vince-fugnitto
left a comment
There was a problem hiding this comment.
The changes work very well for the most part 👍
The only issue I encountered was with the scm view, when a node is correctly identified as a match, collapsing the tree results in the identified node being lost:
I do think its minor however if the bug cannot be fixed properly, but does result in a weird state for end-users.
d365ba7 to
fd057b0
Compare
|
Another good catch. I've added code to hide the search widget when the SCM tree changes view modes, since that invalidates the search results anyway. I tested the file explorer, and it doesn't have problems with collapse all because collapsing doesn't fundamentally change the tree the way that changing view modes changes the SCM tree. |
vince-fugnitto
left a comment
There was a problem hiding this comment.
The changes work very well, I verified the following use-cases:
| Use Case | Result |
|---|---|
explorer (single root) |
👍 |
explorer (multi-root) |
👍 |
scm (tree) |
👍 |
scm (list) |
👍 |
outline |
👍 |
The code changes also look very good.
fd057b0 to
e00d070
Compare
Signed-off-by: Colin Grant <colin.grant@ericsson.com>
e00d070 to
1b59f79
Compare



Signed-off-by: Colin Grant colin.grant@ericsson.com
What it does
This PR fixes #8380 by adding filtering functionality to the tree search box to parallel VSCode's tree search functionality. This makes breaking changes to the logic of the
TreeSearch.filterfunction and theTreeWidget.doUpdateRowsfunction.I have a couple of questions:
_filteredNodesAndParentsinTreeSearchto hold all of the nodes that should be visible when the filter is activated. It might be possible to use one of the existing fields (_filteredNodes), but it should turned into a hash rather than array to avoid traversing the whole thing for every visibility check.shouldDisplayNodemethod in theTreeWidgetelsewhere @akosyakov has said that visibility inTreeWidgets should rely on the node's.visibleto determine visibility. I don't believe that any current Theia code modifies the.visiblefield of aTreeNode, so I opted not to modify it either - especially as that would have required looping over all nodes again after the filter, not just the nodes that pass the filters. In general, there's a division between using a node's fields directly or using a service (e.g.LabelProvider) to derive usable data, and I'm not sure on which side to come down.How to test
xicon or hitting escape.Review checklist
Reminder for reviewers