-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Fix progress notification issues #8479
Conversation
@AlexTugarev Can you review please? |
@DoroNahari, yes sure! I'm happy to do it. |
@@ -66,8 +66,12 @@ export class NotificationManager extends MessageClient { | |||
protected readonly onUpdatedEmitter = new Emitter<NotificationUpdateEvent>(); | |||
readonly onUpdated = this.onUpdatedEmitter.event; | |||
protected readonly fireUpdatedEvent = throttle(() => { | |||
const notifications = deepClone(Array.from(this.notifications.values())); | |||
const toasts = deepClone(Array.from(this.toasts.values())); | |||
const notifications = deepClone(Array.from(this.notifications.values()).filter((notification: Notification) => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
showProgress
/reportProgress
should handle it.
if it's called with empty message
a log entry should be created to give developers (not users!) a hint.
I wonder how vscode
does it. if you provide no message in in showProgress
but in reportProgress
, especially if reportProgress
is called with empty message in between.
does it flicker then? which is my concern this the approach ☝️
maybe we should just accept showProgress
with non-empty message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
showProgress/reportProgress should handle it.
I didn't want it in showProgress because i wanted to handle empty 'regular' notification as well.
Here, is the place i found that handle all kind of notifications. otherwise i will need to look for empty message in many places (showProgress
, reportProgress
, showMessage
and maybe more).
Can you think about other and better place that centralized all of the notifications?
I wonder how vscode does it. if you provide no message in in showProgress but in reportProgress, especially if reportProgress is called with empty message in between.
does it flicker then?
In vscode (and in Theia with this fix) if no message in showProgress
it doesn't show the notification until you reportProgress
with a message.
if reportProgress
is called with empty message but with increment
, the message stays as is and the progress bar updated accordingly. no flickering.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
otherwise i will need to look for empty message in many places (showProgress, reportProgress, showMessage and maybe more).
as far as as I see in showProgress
and in showMessage
, yes. that's where they are added.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So do you agree with this approach?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure yet. We need to check with clients which do not require labels at all, e.g. git
progress with is handled in the progress locations...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My fix is for progress notification.
AFAIK, all git progresses are in the "scm" pane and not as notification. i couldn't found any use of progress notification in Theia.
return !message.options | ||
|| message.options.cancelable === undefined | ||
|| message.options.cancelable === true; | ||
return !!message.options && !!message.options.cancelable; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@akosyakov would that require any change log as it changes the default behavior in theory?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@akosyakov @AlexTugarev
It's been few days since last comment here.
What should be done to promote this pr?
@vince-fugnitto hi, |
I haven't been following discussions related to the pull-request, I initially requested review from Alex since he is the original author of |
Alex asked Anton a question and since Anton didn't answer, i thought maybe you can. Regarding the second thread, i answered all Alex's questions. |
It would of course be good to document the new behavior, if something is breaking (api, behavior or otherwise) then it should be documented as such as well.
I think he had a concern about other clients and determining if they were properly handled such as The provided extension to test with is minimal (it only verifies the |
17a17a3
to
6bd9865
Compare
@AlexTugarev Are there any other concerns i didn't cover here? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested all notification and they seems fine.
One thing is that even when executing "Show Notification Progress" I still see the X button that allows the user to close the notification (no cancel button though).
return !message.options | ||
|| message.options.cancelable === undefined | ||
|| message.options.cancelable === true; | ||
return !!message.options && !!message.options.cancelable; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider return !!message.options?.cancelable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can open a separate issue for the X button on not cancellable. This PR seems fine to me and tested successfully.
6bd9865
to
6cb47c3
Compare
Signed-off-by: Doron Nahari <doron.nahari@sap.com>
6cb47c3
to
3caa1da
Compare
Thank you for noticing this additional issue. i created another issue and fixed it here. |
Thanks! Fix LGTM and tested again. Now no progress shows with X button, only simple notifications. |
Signed-off-by: Doron Nahari doron.nahari@sap.com
What it does
Fixes #6506
Fixes #8421
Fixes #8430
Fixes #8587
How to test
Use this vscode extension sample to reproduce and see the fixes.
Review checklist
Reminder for reviewers