-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Filter button in search box #8540
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
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.
I'll continue the review tomorrow, likely after we perform the release 👍
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.
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. 🤞 |
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.
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. |
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.
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.
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.
Code LGTM
fd057b0
to
e00d070
Compare
Signed-off-by: Colin Grant <[email protected]>
e00d070
to
1b59f79
Compare
Signed-off-by: Colin Grant [email protected]
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.filter
function and theTreeWidget.doUpdateRows
function.I have a couple of questions:
_filteredNodesAndParents
inTreeSearch
to 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.shouldDisplayNode
method in theTreeWidget
elsewhere @akosyakov has said that visibility inTreeWidget
s should rely on the node's.visible
to determine visibility. I don't believe that any current Theia code modifies the.visible
field 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
x
icon or hitting escape.Review checklist
Reminder for reviewers