Skip to content

Leverage notification progress support for progress API #44090

Closed

Description

With the new notifications comes support for showing long running operations:

before 1

We currently have an API where you can show global progress:

before

One advantage of having this within progress is to free space from the status bar and also to indicate from which extension the progress is reported (because notifications always show their source). Another advantage is that we could provide a "Cancel" button to stop the operation.

We could move this into a notification as a first step and could offer additional APIs to:

  • report more detailed progress on the progress bar
  • provide additional actions ("Cancel" for example)

Johannes Rieken (@jrieken) thoughts?

Activity

  1. added
    under-discussion
    workbench-notifications
    on Feb 21, 2018
  2. Tyriar commented on Feb 21, 2018

    @Tyriar
    Contributor

    Sean McManus (@sean-mcmanus) might find this useful for the C++ extension. Related: microsoft/vscode-cpptools#1160

  3. chrisdias commented on Feb 22, 2018

    @chrisdias
    Contributor

    EricJizbaMSFT Matt Hernandez (@fiveisprime) this would be great for the Azure extensions which have long running processes creating resources...

  4. dragonwolf83 commented on Feb 22, 2018

    @dragonwolf83

    This would be useful for the PowerShell Extension as well.

  5. jrieken commented on Feb 28, 2018

    @jrieken
    Contributor

    Yeah, maybe another ProgressLocation is what we want. Something like ProgressLocation.Prominent and then add a cancellation token to the task-callback. An alternative approach would be to have a progress-message, tho it feels wrong

  6. added
    feature-request
    plan-item
    and removed
    under-discussion
    on Mar 5, 2018
  7. added a commit that references this issue on Mar 16, 2018
    5a34f33
  8. added a commit that references this issue on Mar 21, 2018
    3d81ac2
  9. bpasero commented on Mar 21, 2018

    @bpasero
    ContributorAuthor

    Sean McManus (@sean-mcmanus) EricJizbaMSFT Matt Hernandez (@fiveisprime) Troy Campbell (@dragonwolf83) Chris Dias (@chrisdias) this will be in stable API for our March release. You might want to create reminder issues to check it out next month. A sample to use it is:

    vscode.window.withProgress({
        location: vscode.ProgressLocation.Notification,
        title: "this is cool",
        // cancellable: true
    }, (progress, token) => {
        token.onCancellationRequested(() => {
            console.log("CANCELED")
        });
    
        setTimeout(() => {
            progress.report({ percentage: 10, message: "still going..."});
        }, 1000);
    
        setTimeout(() => {
            progress.report({ percentage: 50, message: "still going harder..."});
        }, 2000);
    
        setTimeout(() => {
            progress.report({ percentage: 90, message: "almost there..."});
        }, 3000);
    
        var p = new Promise(resolve => {
            setTimeout(() => {
                resolve();
            }, 5000);
        });
    
        return p;
    });
  10. agauniyal commented on Mar 23, 2018

    @agauniyal

    I hope the progress bar won't be so thin 😕

  11. bpasero commented on Mar 24, 2018

    @bpasero
    ContributorAuthor

    Abhinav Gauniyal (@agauniyal) the UI did not change from what I showed in #44090 (comment) and the size of the progress bar matches with any other progress bar we have in the UI.

  12. locked and limited conversation to collaborators on May 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

apiapi-proposalfeature-requeston-testplanplan-itemworkbench-notifications

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions