Skip to content
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

Allow static contribution of status bar items #167874

Open
mjbvz opened this issue Dec 1, 2022 · 12 comments
Open

Allow static contribution of status bar items #167874

mjbvz opened this issue Dec 1, 2022 · 12 comments
Assignees
Labels
api api-proposal feature-request Request for new features or functionality on-testplan under-discussion Issue is under discussion for relevance, priority, approach workbench-status Status bar
Milestone

Comments

@mjbvz
Copy link
Contributor

mjbvz commented Dec 1, 2022

Problem

The LiveShare extension is currently * activated. I believe the main reason for this is so they can contribute a Live Share button in the status bar

Screenshot 2022-12-01 at 11 53 14 AM

This is currently only possible to do in code

Proposal

Add a new contribution point that lets extensions contribute a static item (potentially with a when clause) to the status bar. Clicking on this item should trigger a command, which can then activate the full extension

/cc @isidorn @bamurtaugh @jramsay @joyceerhl

@mjbvz
Copy link
Contributor Author

mjbvz commented Dec 1, 2022

Other options for the LiveShare team to consider:

  • Put the LiveShare button somewhere else in the UI?

    We already support static contributions to various menus in the editor. Could LiveShare use the editor toolbar menu or maybe the settings gear menu?

  • Live share already has an activity bar item, do we also need something in the status bar?

    Not sure if this view is enabled by default or not though

  • Ship a minimal * activated extension that only provides the status bar item. Clicking on the item can then activate the full live share extension

    This would work but is likely too complicated

@jrieken jrieken added feature-request Request for new features or functionality api under-discussion Issue is under discussion for relevance, priority, approach workbench-status Status bar labels Dec 2, 2022
@jrieken
Copy link
Member

jrieken commented Dec 2, 2022

Add a new contribution point that lets extensions contribute a static item

I would suggest something even simpler which is a just a menu identifier for the status bar. So, LS would contribute an ordinary command and place it into that special menu. That's similar to the statusBar/remoteIndicator-menu

@joyceerhl
Copy link
Contributor

@jramsay
Copy link
Member

jramsay commented Dec 7, 2022

Live Share moved away from * activation in the latest release: 1.0.5788. We were able to replace * with onStartupFinished.

If it is preferable to only activate on demand then the Activity Bar icon also appears to be an issue.

image
I tested it out against the latest Insiders and our Live Share Icon only shows up in the activity bar after we've activated. Is this the expected behavior? I was thinking it would show up even when we aren't activated as it is a contribution point in the package.json:

image

Then when the user clicks on the Activity Bar icon it would trigger activation to load the views.

@sandy081
Copy link
Member

View container in the activity bar will be visible only if there are active views in it. I suspect in this case there are no active views in this view container. When the extension got activated, views in this view containers are also enabled by some when contexts set on these views. I also assume these views are contributed the same extension and has when contexts.

@jramsay
Copy link
Member

jramsay commented Mar 31, 2023

Revisiting this item. As per @sandy081's comment we were able to get the Live Share icon to show up in the activity bar pre- activation which is great! We're also able to add the Share & Join options to the remote indicator menu pre-activation. Those are still quite hidden though.

Looking at telemetry, approx. 42% of our collaboration sessions are initiated via the Live Share status bar button. Given the usage of this button is so high, removing it would have quite an impact on the current user experience.

Are you open to allowing static contribution of status bar items (pre-activation)? If this isn't desirable for all extensions perhaps for approved extensions only?

@jrieken jrieken added this to the May 2023 milestone Apr 28, 2023
@jrieken
Copy link
Member

jrieken commented Apr 28, 2023

@jramsay is LS's status bar contribution in any way dynamic or always the same label, icon, command etc? I am asking because I wonder if it's enough to have a status bar menu to which commands can be registered (analog to other menus) or if we need the full deal with a dedicated contribution point, an activation event etc pp

@jramsay
Copy link
Member

jramsay commented May 9, 2023

@jrieken: it is dynamic in that the Live Share button only shows when our extension is activated and the user is not in a Live Share session. When they are the host or guest of a session it is replaced by either Shared or Joined and when pressed has different dropdown options:

Shared
image

Joined
image

I think as long as we can keep the current behavior where the Live Share button is prominent in the status bar even when our extension isn't activated that would be great, given it has such high usage:

image

@a-stewart
Copy link
Contributor

We would also find it useful to have the ability to contribute static statusbar items without needing to have the extension active on startup

@jrieken
Copy link
Member

jrieken commented May 24, 2023

@a-stewart can you share more about your use-case for this API?

@jrieken jrieken modified the milestones: May 2023, June 2023 May 30, 2023
@jrieken jrieken modified the milestones: June 2023, July 2023 Jun 8, 2023
@mjbvz mjbvz modified the milestones: July 2023, Backlog Jul 10, 2023
@a-stewart
Copy link
Contributor

Hi,

Sorry for not replying to this - I missed the comment notification.

The proposed API looks ideal - one thing I would ask though is if it would be possible to add a when clause to the status bar item to configure when it is shown.

I guess something to consider would be how this interacts with .show() and .hide() when called from the code.

@tjx666
Copy link
Contributor

tjx666 commented Oct 9, 2023

git graph extension also face the same issue: mhutchie/vscode-git-graph#377

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api api-proposal feature-request Request for new features or functionality on-testplan under-discussion Issue is under discussion for relevance, priority, approach workbench-status Status bar
Projects
None yet
Development

No branches or pull requests

7 participants