-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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 notification queue and display using toast #12959
Conversation
Thanks for making a pull request to jupyterlab! |
API: re-surfacing a comment from #689 (comment) and re-phrasing it to: should we use the same buttons API as in jupyterlab/packages/apputils/src/dialog.tsx Line 524 in 758c00c
|
@krassowski I do like the idea of standardizing our many button interfaces |
@telamonian Thanks for the PR. I am fine with us implementing the full notification system incrementally, and I think this capability is a good start. At the same time, APIs are difficult to change. Have you (or can you) sync with @afshin and @andrii-i about the work they have done on the broader notification system and the API requirements therein? Best case scenario, any additional APIs needed could be added during the 4.0 release cycle without breaking anything. I think they were using parts of |
Notes for the integration:
👍 for example a follow-up could be to add a manager as middle-man between the notification interface and the display (to allow for history or for filtering).
Although it will be nice to avoid separating those definitions, I don't think it will be possible. The main reason is the behavior difference between a dialog and a notification. In the dialog case, it prompts the user to do immediate action blocking other UI elements. For that our API uses a promise returning the result of the dialog. This will not fit for a toast that has a behavior emit a message and go-on. Hence the use of |
@telamonian I have taken the freedom to push this one to be able to get it into 3.5. |
a7a1389
to
67b6ea3
Compare
bot please update snapshots |
2ad4e8d
to
72f2136
Compare
bot please update documentation snapshots |
a3f54a4
to
4ee441f
Compare
4ee441f
to
1bc6fa5
Compare
Co-authored-by: Michał Krassowski <5832902+krassowski@users.noreply.github.com>
31c2cba
to
7538f03
Compare
bot please update galata snapshots |
bot please update galata snapshots |
Kicking CI |
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.
We discussed this at the team meeting today, the question of returning a string vs an IDisposable
was deferred to a follow up PR with good arguments for having a string (allowing other actors to act on notification e.g. in RTC context) and for IDisposable
(type safety, developer convenience).
This PR currently uses a string with ID but it can be changed in a follow up PR before 4.0 release if needed.
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.
Thanks all for the reviews
export const notificationPlugin: JupyterFrontEndPlugin<void> = { | ||
id: '@jupyterlab/apputils-extension:notification', | ||
autoStart: true, | ||
requires: [IStatusBar], |
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.
Is IStatusBar
really required for this plugin? Or could it also be made optional?
Or move the status bar related logic to a separate plugin so the commands are still available.
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.
The only UI entry point for the notification is a status bar widget - as for the log console.
I don't know what would be the best solution for Notebook v7 - as we should promote not disturbing the user with many toasts.
This definitely needs to be discussed for notebook v7 (including the log console that I guess is not loaded neither for now).
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.
If the status bar is the only part of the UI where notifications are displayed for now then Notebook 7 can just ignore for now.
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.
Although it would be great to have to leverage announcements features in nb7 like #13365
@meeseeksdev please backport to 3.6.x |
Owee, I'm MrMeeseeks, Look at me. There seem to be a conflict, please backport manually. Here are approximate instructions:
And apply the correct labels and milestones. Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon! Remember to remove the If these instructions are inaccurate, feel free to suggest an improvement. |
…y using toast) (#13360) * Backport PR #12959: Add notification queue and display using toast * Update Playwright Snapshots * Fix button styles * Update Playwright Snapshots * markedparser-extension does not exists in 3.x Co-authored-by: Max Klein <telamonian@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Adds toast ui to jupyterlab. I've taken @fcollonval's code from jupyterlab_toastify and merged it into ui-components. Currently non-functional draft.
References
Fixes #689
#7980
#12827
Code changes
NotificationManager
; aka a notification queue with achanged
signal to be notifiedNotification
to access to the manager (discourage for final user) and helper functions to emit notifications of various type (success, warning, error, info, in-progress or default) and helpers to update and dismiss a notification.This is accessible globally from
@jupyterlab/apputils
- it does not require to request token in plugins.@jupyterlab/apputils-extension:notification
thatapputils:notify
to emit a notification andapputils:dismiss
to dismiss a notificationautoClose
option is set to a positive number, a toast will be emitted. Otherwise the notification will be accessible by the user when clicking on the status bar widget (the goal is to limit disturbance of pop ups to the user)User-facing changes
Backwards-incompatible changes
N/A