vscode
vscode copied to clipboard
badges on custom activities added to activity bar by extensions
Previously mentioned by @eamodio in https://github.com/Microsoft/vscode/issues/43645#issuecomment-378261837 where @sandy081 asked to create separate issues for more specific features.
It would come helpful if extensions which create new activity in activity bar could also display a badge with a count. For example https://github.com/Gruntfuggly/todo-tree/issues/22 has request to show number of TODO/FIXME found in the project.
@elf-pavlik The progress indication will show the a tree view operation is in progress. And since the tree views is the only thing we support here I was assuming that what we have is good enough. What the scenario here? You update something but don't yet update the tree?
A user defined counter would be useful. In my case the tree contains search results, so the counter would be a useful indication.
@Gruntfuggly Not sure search results is a good example also the existing Search viewlet does not show the count.
I think it's different from search.
Search is a tab you open to search and close right after that, the information there is no longer needed.
In the Todo case, it's a useful information all the time, same as version control information, even with the tab closed.
The source control view show a badge with a count of the number of items in the view - I think that's all that users are really asking for - they want to know how many items are in the view without needing to open it.
What I meant the given example is not appealing. A badge being shown means it should be for a prominent reason like SCM outgoing changes. I see how it might be useful in case of Todo.
I would love to get badge support too. For my use case, I have a custom activity bar item that shows the status of remote jobs. I would really like to show an indication that something is running without the user having to expand the view.
It could be handy to have the option for a count badge or a plain "dot" badge in cases where we know something is running, but we might not know the exact count.
Thanks!
I have another case: a task view using VSCode task API. If the custom activity bar icon can show a number to indicate how many tasks are running (especially long running background tasks), then a user doesn't need to expand the view if they just want to make a sure a task is not running.
As an alternative to badges in the activity bar, how about allowing badges in the title bar of a view when it is collapsed? That way an icon could be displayed to indicate that something has changed in the view.
+1 for this
Just installed the todo add on, and it would be awesome to see a count in these things without having to open it.
Could we also consider a badge color properly and support for displaying without a number? I would like to show online/away/offline status in https://teamhub.dev/ as we do in IntelliJ (bottom left on first screenshot)
I am developing a team-centric activity and it would be very useful to have some means of indicating there are changes on that activity that a user would want to be notified about.
There is a new API coming up allowing the title to be changed. Not quite badges, but it will at least allow something to be shown.
We are developing a static analysis extension that find issues in your code. It would be nice to denote in the icon how many issues are currently existing without having the user to move away from their editor screen to see this number. Just a thought.
Is there any way to show how many todos there are for a codepath inside the tree?
I have lots of large codebases and monorepos, so it would be great if we could see which packages had the most TODOs.
Do you mean subtotals for each tree node? If you enable todo-tree.tree.showCountsInTree
it will show the number of children for each node.
Oh perfect - I've just been customising all the details - colours, icons and more and somehow totally missed that option.
Thanks 🙏
Going back to the badge problem, i have a scenario in which we scan the repos for issues. It will be good to show the count of issues found on the badge. Any update on this. Last post was Dec'19 so not sure where are things now.
+1
+1
Any updates on this proposed and sought after feature?
Any updates?
Would be perfect for my custom extension. Is this planned at some point?
I guess not, unfortunately.
It's been 2 years since the latest update from the team (adding Backlog
label), with no additional info.
I would love to have this as well, but decided to use a workaround. Instead of the badge in the Activity Bar, I used the added Treeview.Title
property, concatenating the number of items I would like to show. It's not the same, but gives the message.
Hope this helps
Hello @sandy081 @alexr00, I am interested in implementing this, it seems to be a popular request from a number of extension authors. I've looked into how the activity count code works and am curious what kind of extension API you think might make sense for this:
- An optional event on
TreeDataProvider
andWebviewViewProvider
that can be used to publish a badge for a tree/webview based views. - Alternatively, a separate provider that can be registered to provide the badge for the activity ViewContainer as a whole.
And finally, is there any reason you think I shouldn't go ahead attempting to implement this? Any reasons this wouldn't be a good addition? Thanks!
I've made two PRs with example APIs and would appreciate feedback:
1: An event on TreeDataProvider / WebviewViewProvider that allows providing activity information: https://github.com/microsoft/vscode/pull/139225 2: A new interface for providing activity information: https://github.com/microsoft/vscode/pull/139229
I am leaning towards the second proposal (https://github.com/microsoft/vscode/pull/139229). I have an implementation of this API in another PR here: https://github.com/microsoft/vscode/pull/139539/files.
What I meant the given example is not appealing. A badge being shown means it should be for a prominent reason like SCM outgoing changes. I see how it might be useful in case of Todo.
@sandy081 It would be helpful for our team if we could display a badge on our extension's Activity Bar icon when there is an update to our software available.
@alexr00 What things can we do to help make this functionality available for VSCode extension developers?
@hamirmahal glad to hear you are interested in this API. We have slowly started to work on this feature with the help of @matthewjamesadam For now no further help from the community is required. Thank you for offering though!