-
Notifications
You must be signed in to change notification settings - Fork 34.1k
Add badges extension API #139225
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
Add badges extension API #139225
Conversation
@matthewjamesadam thanks for the proposal PR! Of your two proposals, this one is closer to what we want. A few notes from our discussion on it:
|
Thanks for taking the time to discuss this! I have updated this PR to reflect your feedback:
There are a couple of issues I'd appreciate further feedback on:
Thanks again! |
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.
We had an opportunity to discuss the new proposal. A few more changes, then we can discuss implementing it.
# Conflicts: # src/vs/workbench/services/extensions/common/extensionsApiProposals.ts
Thanks for your feedback @alexr00 , I have updated the PR to reflect it. |
@matthewjamesadam thanks for working on this! I'm an extension developer and have a question regarding the API. From what I understand, this PR seems to add badges to |
Hi @lgrammel -- yes I believe the badge would be an aggregate of the values for all the container's views. There was an alternative proposal for a badge API here: #139229 that allowed providing a single badge for the entire viewContainer, but it is a more complicated API (it requires a separate Provider interface, since viewContainers don't have any interface representation in the API). @alexr00 might have more thoughts on this though! |
I think we'd do one of two things:
I don't think we'll ever show multiple badges on one container though as this will get very cluttered very quickly. |
Thanks - both of those options would work well for my use case. Really excited about this feature, looking forward to having it part of VS Code! |
@alexr00 that makes sense! Do you have any other feedback for this proposal? Is there anything else I can do to help push this forward? I'd be happy to prepare a draft PR implementing this as well, with the understanding that this proposal might change in the future. |
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.
Just adding a few minor comments on the api proposal
/** | ||
* A label to present in tooltips for the badge | ||
*/ | ||
label: string; |
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.
These properties should be readonly as I don't think we support updating the badge if you do treeView.badge.value = 1
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.
Done.
/** | ||
* A label to present in tooltips for the badge | ||
*/ | ||
label: string; |
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 believe we use tooltip
(instead of label
) in other places in vscode.d.ts
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.
Done.
@matthewjamesadam We'll try to discuss during our weekly API meeting this week (there was no meeting last week because of our endgame). After that, we can look into a PR. |
Hi @alexr00, do you have any updates on this? Did you manage to discuss this proposal at the API meeting? Thanks! |
I haven't had a chance to bring this to our API discussion. I will post an update as soon as I have one! |
/** | ||
* A badge presenting a value for a view | ||
*/ | ||
export interface Badge { |
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.
Maybe call them ViewBadge
?
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.
@matthewjamesadam we had a chance to discuss last week. This proposal is heading in the right direction! If you want to make a PR that implements this feature/API I will be happy to review it.
This is a WIP for getting feedback for #62783
Alternative API can be seen here: #139229