-
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
Fix Highlighting in SCM Tree #8929
Fix Highlighting in SCM Tree #8929
Conversation
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.
@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 |
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 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 <[email protected]>
488db3a
to
ddaaa69
Compare
What it does
This PR fixes #8581 by adjusting the
ScmTreeLabelProvider
class to provide labels for all of theScmTreeWidget
node types and then using thesearchHighlights
map to produce a highlighted caption. This introduces adjustments to the interfaces of the variousScmTreeWidget
node types, but those could be made non-breaking by adding| ReactNode
to the previous specifications, if that is desirable.How to test
Review checklist
Reminder for reviewers