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

Support indeterminate progress notifications in message service #10944

Closed
planger opened this issue Mar 29, 2022 · 1 comment · Fixed by #10945
Closed

Support indeterminate progress notifications in message service #10944

planger opened this issue Mar 29, 2022 · 1 comment · Fixed by #10945
Labels
notifications issues related to notifications progress issues related to the progress functionality

Comments

@planger
Copy link
Contributor

planger commented Mar 29, 2022

Clients can report progress via the message service, which then would show up as follows:
message-service-progress-reporting

However, also as can be seen in the first notification state "Doing something", the notification doesn't show any progress indication if there is no work progress being specified. Thus, the notification can't be distinguished from plain info notifications. However, reporting progress with indeterminate progress is often useful, e.g. when dealing with external processes.

Feature Description:

I suggest to show an indeterminate progress indication if clients report progress without specifying a work progress. This is also in line with VS Code, which shows an indeterminate progress indicator if clients don't specify progress.

The following should show indeterminate progress:
Peek 2022-03-29 13-22

this.messageService
    .showProgress({
        text: 'Starting to report indeterminate progress',
    })
    .then(progress => {
        // do something
        progress.report({
            message: 'First step completed',
        });
        // do something
        progress.report({
            message: 'Next step completed',
        });
        // do something
        progress.report({
            message: 'Complete',
        });
        // do something
        progress.cancel();
    });

And the following should report actual progress:
Peek 2022-03-29 13-21

this.messageService
    .showProgress({
        text: 'Starting to report progress',
    })
    .then(progress => {
        // do something
        progress.report({
            message: 'First step completed',
            work: { done: 25, total: 100 }
        });
        // do something
        progress.report({
            message: 'Next step completed',
            work: { done: 60, total: 100 }
        });
        // do something
        progress.report({
            message: 'Complete',
            work: { done: 100, total: 100 }
        });
        // do something
        progress.cancel();
    });
@planger
Copy link
Contributor Author

planger commented Mar 29, 2022

I'll submit a PR for that soon.

planger added a commit to eclipsesource/theia that referenced this issue Mar 29, 2022
  * Default to `progress` notification type if `showProgress()` is used
     instead of overwriting it with `info`
  * Pass through `progress` notification type to view
  * Show indeterminate progress animation if type `progress`
     but without specifying a numeric `progress` value > 0
  * Use `info` icon by default in view for `progress` notifications
  * Add sample menu contributions to document and test progress
    notifications with determinate and indeterminate progress

Fixes eclipse-theia#10944

Change-Id: Ieaf0e775cd1ad282b396c26c9047f4930f483712
@vince-fugnitto vince-fugnitto added messaging issues related to messaging progress issues related to the progress functionality notifications issues related to notifications and removed messaging issues related to messaging labels Mar 29, 2022
planger added a commit to eclipsesource/theia that referenced this issue Mar 29, 2022
  * Default to `progress` notification type if `showProgress()` is used
     instead of overwriting it with `info`
  * Pass through `progress` notification type to view
  * Show indeterminate progress animation if type `progress`
     but without specifying a numeric `progress` value > 0
  * Use `info` icon by default in view for `progress` notifications
  * Add sample menu contributions to document and test progress
    notifications with determinate and indeterminate progress

Fixes eclipse-theia#10944

Change-Id: Ieaf0e775cd1ad282b396c26c9047f4930f483712
JonasHelming pushed a commit that referenced this issue Mar 30, 2022
* Default to `progress` notification type if `showProgress()` is used
     instead of overwriting it with `info`
  * Pass through `progress` notification type to view
  * Show indeterminate progress animation if type `progress`
     but without specifying a numeric `progress` value > 0
  * Use `info` icon by default in view for `progress` notifications
  * Add sample menu contributions to document and test progress
    notifications with determinate and indeterminate progress

Fixes #10944

Change-Id: Ieaf0e775cd1ad282b396c26c9047f4930f483712
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
notifications issues related to notifications progress issues related to the progress functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants