vscode icon indicating copy to clipboard operation
vscode copied to clipboard

badges on custom activities added to activity bar by extensions

Open elf-pavlik opened this issue 5 years ago • 37 comments

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.

badge

elf-pavlik avatar Nov 08 '18 13:11 elf-pavlik

@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?

jrieken avatar Nov 08 '18 14:11 jrieken

A user defined counter would be useful. In my case the tree contains search results, so the counter would be a useful indication.

Gruntfuggly avatar Nov 09 '18 08:11 Gruntfuggly

@Gruntfuggly Not sure search results is a good example also the existing Search viewlet does not show the count.

sandy081 avatar Nov 12 '18 14:11 sandy081

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.

SergioTx avatar Nov 12 '18 14:11 SergioTx

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.

Gruntfuggly avatar Nov 12 '18 14:11 Gruntfuggly

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 avatar Nov 12 '18 15:11 sandy081

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!

gim-m avatar Nov 28 '18 19:11 gim-m

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.

cnshenj avatar Mar 26 '19 21:03 cnshenj

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.

Gruntfuggly avatar Apr 04 '19 13:04 Gruntfuggly

+1 for this

spmeesseman avatar Apr 21 '19 02:04 spmeesseman

Just installed the todo add on, and it would be awesome to see a count in these things without having to open it.

andrewbarnesweb avatar Jun 05 '19 14:06 andrewbarnesweb

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)

nbransby avatar Jul 12 '19 11:07 nbransby

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.

mholtzhausen avatar Jul 24 '19 20:07 mholtzhausen

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.

Gruntfuggly avatar Oct 12 '19 10:10 Gruntfuggly

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.

luisjotapepe avatar Dec 17 '19 22:12 luisjotapepe

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.

ErisDS avatar Apr 27 '20 14:04 ErisDS

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.

Gruntfuggly avatar Apr 27 '20 14:04 Gruntfuggly

Oh perfect - I've just been customising all the details - colours, icons and more and somehow totally missed that option.

Thanks 🙏

ErisDS avatar Apr 27 '20 14:04 ErisDS

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.

ngarg-panw avatar Apr 29 '20 17:04 ngarg-panw

+1

ycjcl868 avatar Aug 17 '20 03:08 ycjcl868

+1

lorenzo-deepcode avatar Aug 21 '20 09:08 lorenzo-deepcode

Any updates on this proposed and sought after feature?

joelmagner avatar Mar 17 '21 23:03 joelmagner

Any updates?

vjocw avatar Jul 28 '21 22:07 vjocw

Would be perfect for my custom extension. Is this planned at some point?

chsxf avatar Nov 12 '21 15:11 chsxf

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

alefragnani avatar Nov 12 '21 20:11 alefragnani

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 and WebviewViewProvider 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!

matthewjamesadam avatar Dec 14 '21 00:12 matthewjamesadam

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

matthewjamesadam avatar Dec 15 '21 19:12 matthewjamesadam

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.

matthewjamesadam avatar Dec 20 '21 22:12 matthewjamesadam

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 avatar Jan 17 '22 16:01 hamirmahal

@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!

isidorn avatar Jan 18 '22 13:01 isidorn