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

add a progress notification when performing any git clone #4483

Closed
wants to merge 2 commits into from

Conversation

olexii4
Copy link
Contributor

@olexii4 olexii4 commented Mar 5, 2019

Add a progress notification when performing any git clone.

screenshot from 2019-03-05 18-25-02

Related issue: eclipse-che/che#12564

Signed-off-by: Oleksii Orel oorel@redhat.com

Signed-off-by: Oleksii Orel <oorel@redhat.com>
@olexii4 olexii4 changed the title add progress when performing a git clone add a progress notification when performing any git clone Mar 5, 2019
@akosyakov
Copy link
Member

cc @svenefftinge @kittaakos

@vinokurig
Copy link
Contributor

It is strange for me that the notification can be closed by itself, even if clone is not finished yet. The button that restores the notification looks not obvious, I mean it is not clear what it does.

@olexii4 olexii4 marked this pull request as ready for review March 6, 2019 08:46
@olexii4
Copy link
Contributor Author

olexii4 commented Mar 6, 2019

@vinokurig I add it like a proposal. Because it will be nice for me to hide an annoying notification after 10s.
Ok. I will improve the status bar widget. I will add a text "Tasks in progress: 3/10" nex the icon and change the tooltip.

@olexii4
Copy link
Contributor Author

olexii4 commented Mar 6, 2019

screenshot from 2019-03-06 15-25-45
screenshot from 2019-03-06 15-31-08

@olexii4
Copy link
Contributor Author

olexii4 commented Mar 6, 2019

WDYT?

@svenefftinge
Copy link
Contributor

Yes, why not. Ideally we would do the clone in the terminal and rely on the natural output of git.
@AlexTugarev could you have a look at the changes regarding the notifications?

@AlexTugarev
Copy link
Contributor

I really like the idea to show the progress git clone, actually of all kind of long running operations. However I think the UX didn't work in my test:

Starting a git clone operation

It shows Cloning the git repo progress notification 👍
screen shot 2019-03-07 at 08 20 18

The progress notification disappears after a short while, but I see spinner icon in the status bar for just two seconds.

Starting a second clone operation

... of a git repo containing a lot of objects.
2019-03-07 08 16 38

And now I see purpose of the status bar item. I says Tasks in Progress 1/1 and it reveals the progress notification which was hidden previously.

It's not clear why the progress is hidden in the first place. Especially the progress notifications are meant to report progress continuously:
https://github.com/theia-ide/theia/blob/56222486fd076d3d71887e5e629152015faf88e5/packages/core/src/common/message-service-protocol.ts#L61-L71

And we can easily add the progress reporting from dugite-extra in the Git interface, see ICloneProgress
which is to be add here:
https://github.com/theia-ide/theia/blob/56222486fd076d3d71887e5e629152015faf88e5/packages/git/src/node/dugite-git.ts#L339

@olexii4 could you explain what the benefit of the status bar item is? Also, have you seen #2461? The generic progress reporting mechanism seems very similar.

Copy link
Contributor

@AlexTugarev AlexTugarev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Besides the UX concerns mentioned above, there is a Emitter leak, cf.

WARN Error: Possible Emitter memory leak detected. 30 exit listeners added. Use event.maxListeners to increase limit
    at Emitter.../../packages/core/lib/common/event.js.Emitter.checkMaxListeners (https://3000-a1d2c682-c255-4618-a5e6-60887fe22915.ws-eu0.gitpod.io/bundle.js:97020:26)
    at Notifications._event.Object.assign.maxListeners [as onShow] (https://3000-a1d2c682-c255-4618-a5e6-60887fe22915.ws-eu0.gitpod.io/bundle.js:96987:27)
    at Notifications.push.../../packages/messages/lib/browser/notifications.js.Notifications.createNotificationElement (https://3000-a1d2c682-c255-4618-a5e6-60887fe22915.ws-eu0.gitpod.io/78.bundle.js:503:18)
    at Notifications.push.../../packages/messages/lib/browser/notifications.js.Notifications.create (https://3000-a1d2c682-c255-4618-a5e6-60887fe22915.ws-eu0.gitpod.io/78.bundle.js:463:66)

@olexii4
Copy link
Contributor Author

olexii4 commented Mar 7, 2019

@AlexTugarev
I have fixed the error and want to explain the benefit of the status bar item:
For this moment we have a possibility to show progress message with possible actions to the user. But, in general case, the progress message is shown under the command palette. And we should close all notifications for working with the command palette.
But, in the case when we close the existing progress message - lost the opportunity to know when the progress will be canceled.

With my improvement, we close any progress message in time from the preferences(notification.timeout). Then can reopen with the status bar widget.

And I added minimal changes to improve existing progress message, to become more convenient to users because we are using it with our API. And this improvement was added in the area of the issue "add progress when performing any git clone" like a separate commit to improving their behavior.

Progress extension looks very nice. But still not merged from the 2018 summer season. And the big improvement cannot be done in the issue of adding existing progress notification for git clone.

I can create The separate issue for progress message improvement when the progress extension will be merged. Like a part for withProgress improvement(theia.d.ts).

Signed-off-by: Oleksii Orel <oorel@redhat.com>
@@ -48,21 +52,59 @@ export class NotificationsMessageClient extends MessageClient {
}

showProgress(progressId: string, message: ProgressMessage, cancellationToken: CancellationToken, update?: ProgressUpdate): Promise<string | undefined> {
const messageArguments = { ...message, type: MessageType.Progress, options: { ...(message.options || {}), timeout: 0 } };
if (this.visibleProgressNotifications.has(progressId)) {
const messageArguments = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why should the default value for timeout be changed now?

Copy link
Contributor Author

@olexii4 olexii4 Mar 7, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we remove , timeout: 0 it will get it from preferences['notification.timeout']

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got it. the question is, why should that be the case in general? what is wrong about it in general? besides the git clone operation, the main use case when introducing this feature was to allow progress reporting. what happens with that now?

if the source for progress reports stops updating, will this dismiss the progress notification?

if you think this should be a short timeout value for git clone in this PR, why not just setting it explicitly?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cannot understand you. Previously it was shown without a close timeout at all timeout: 0.

If the source for progress reports stops updating(as I understand - cancel this progress notification
https://github.com/theia-ide/theia/pull/4483/files#diff-cde0e8b29563cef99910b9e41f4daab7R89
), will this dismiss the progress notification.

@AlexTugarev
Copy link
Contributor

But, in general case, the progress message is shown under the command palette. And we should close all notifications for working with the command palette.

The problem is, that the UI for notification is worn out and needs a refresh.

But here, a fix of the z-order of the notification would solve the issue, right? If you still can use the command palette while the progress notification is visible, you don't need to dismiss it automatically.

With my improvement, we close any progress message in time from the preferences(notification.timeout).

What is the reason to change this default?

Progress extension looks very nice. But still not merged from the 2018 summer season. And the big improvement cannot be done in the issue of adding existing progress notification for git clone.

Well, isn't it worth spending time on finishing stuff? The progress UI just had no (well) working application. The git clone would be a good candidate, especially with the hints about the progress reporting from above. I'd rather see progress extension redux using the git clone case as an application of it, instead of adding yet another shortcut.

I'm releasing the break as the memory leak is gone. But please get more people convinced of the UX.

@AlexTugarev AlexTugarev self-requested a review March 7, 2019 17:02
@AlexTugarev AlexTugarev dismissed their stale review March 7, 2019 17:04

the leak is gone

@@ -77,11 +77,16 @@ export class GitQuickOpenService {
dynamicItems.push(new SingleStringInputOpenItem(
`Clone the Git repository: ${lookFor}. ${suffix}`,
async () => {
const progress = await gitQuickOpenService.messageService.showProgress({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cf. links in:
eclipse-che/che#12564 (comment)
eclipse-che/che#12564 (comment)

it was discussed couple of times before. and it would really make sense so tackle this in a more generic way.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. There's more general issue #759.

What about approve improvements for inProgress notifications only?
We are using them in our API and it will be nice to improve the existing behavior. In this case, I will remove the first commit and change the PR description

@olexii4
Copy link
Contributor Author

olexii4 commented Mar 11, 2019

@AlexTugarev
Could we discuss the second commit for inProgress notification improvements only? I am sure it will be a good improvement

@olexii4 olexii4 closed this Mar 15, 2019
@olexii4 olexii4 mentioned this pull request May 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants