Fix Highlighting in SCM Tree#8929
Conversation
vince-fugnitto
left a comment
There was a problem hiding this comment.
@colin-grant-work the changes now highlight the matches in the tree based on the search query. I'll need to confirm it still works correctly using the git built-in extensions.
I did notice the following issues that I'm not sure should be handled by the pull-request:
When no nodes are present, we still highlight the tree (which looks incorrect).
Changes is highlighted even though it is not part of the changeset but just a category (it is also highlighted in a different color):
I'm happy to handle these in the current PR, though I'm not sure what behavior is most desirable. Arguably, if there are no changes, there's no need to render the top-level node at all (similar to how the Navigator doesn't render the top workspace node if it isn't a directory) so we could:
I'm inclined to opt for 1 and 3. Don't render the node if it isn't informative, and if it is rendered, highlight the same as any other node. Does that sound reasonable? |
I know that it is done this way since it aligns with vscode, they display the I think we should be consistent with the behavior present in vscode for the moment, and fix the highlighting of this node (removing the highlighting versus fixing the color). |
c0390a5 to
488db3a
Compare
|
@vince-fugnitto, I've pushed up a version that documents the breaking (and non-breaking) changes in the |
vince-fugnitto
left a comment
There was a problem hiding this comment.
The changes work well for me, I now see that highlighting works well for scm.
I also verified the changes using the git built-in extensions instead of @theia/git:
"vscode-builtin-git": "https://open-vsx.org/api/vscode/git/1.39.1/file/vscode.git-1.39.1.vsix",
"vscode-builtin-git-ui": "https://open-vsx.org/api/vscode/git-ui/1.39.1/file/vscode.git-ui-1.39.1.vsix"
Signed-off-by: Colin Grant <colin.grant@ericsson.com>
488db3a to
ddaaa69
Compare



What it does
This PR fixes #8581 by adjusting the
ScmTreeLabelProviderclass to provide labels for all of theScmTreeWidgetnode types and then using thesearchHighlightsmap to produce a highlighted caption. This introduces adjustments to the interfaces of the variousScmTreeWidgetnode types, but those could be made non-breaking by adding| ReactNodeto the previous specifications, if that is desirable.How to test
Review checklist
Reminder for reviewers