-
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
core: add support for badge decorations #8156
Conversation
@akosyakov Thank you for your previous review in #8148. @vince-fugnitto updated the code so that |
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.
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 wise looks good to me
@vince-fugnitto Could you test please?
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, the badges are correctly displayed in the sidepanel and horizontal areas:
scm
- verified that the number of working tree changes are correctly displayed
- verified that the number reflects new changes, discards
- verified using the builtin vscode git extension as well
problems
- verified that the problems-view correctly displays the number of problem statistics
- verified that the number is updated when new problem markers are created, or fixed
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 pretty well for me.
-
Tested the scm. It correctly updates the badge count, and upon reverting changes it also decreases the counter.
-
Tested the problems view. It correctly identifies the value of the markers, and if any marker is removed it correctly updates it.
Tested on Windows.
repository.provider.onDidChange(() => this.fireDidChangeDecorations()) | ||
); | ||
} else { | ||
this.fireDidChangeDecorations(); |
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.
it should happen always, not only in else
There is a bug when doing the following:
From this point on, the badge won't update.
|
It does not need to implement |
The following commit adds support for a new type of widget decoration called a `badge` which is essentially a notification for which widgets can contribute a counter to for display purposes. The commit includes two new client contributions from: - `scm`: contributes a `badge` counter for number of changes in the working tree. - `markers`: contributes a `badge` counter for the number of problem marker stats. Co-authored-by: Kaiyue Pan <[email protected]> Co-authored-by: vince-fugnitto <[email protected]> Signed-off-by: Kaiyue Pan <[email protected]> Signed-off-by: vince-fugnitto <[email protected]>
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, the decoration continues to successfully listen to changes when the views are moved in the layout 👍
I'll merge the pull-request Monday if there are no objections.
@vince-fugnitto merging too? |
@akosyakov yes, are there are any objections? |
@vince-fugnitto no, a follow up issue to add a badge for the debug view container would be nice to show how many sessions is running for instance |
What it does
Fix: #4311
Fix: #4782
The following pull-request introduces a new 'widget-decoration' called
badge
which can be used to decoratetab-bars
with a counter for display purposes. The decoration is useful as a means to notify end-users about an important feature such as the number of scm changes currently in the working tree, and/or the number of problem marker stats (infos, warnings and errors).The pull-request also includes two new client contributions to make use of the new decoration for their respective views:
scm
: displays the number of changes in the working tree and is updated according to theprovider
.markers
: displays the number of total problem marker stats for the workspace (infos, warnings, and errors).Features:
99+
is displayed)SCM:
Problems:
How to test
Scm
view (should see a badge that displays the number of git changes)Problems
view (should see a badge that displays the total number of problems)Review checklist
Reminder for reviewers
Signed-off-by: Kaiyue Pan [email protected]
Signed-off-by: vince-fugnitto [email protected]