-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Multiple messages in the SnackBar #8733
Conversation
Hi @yogeshvar, thanks for your PR, whick looks very promising.
|
For the java open module problem you need to modify the build.gradle file and add a line to the addOpens for the concrete class
|
Thanks for the quick response, @calixtus @Siedlerchr 🍾 . I have resolved the module issue after modifying the try {
Class<?> clazz = Class.forName("org.controlsfx.control.Notifications");
// get declared class
Class<?>[] classes = clazz.getDeclaredClasses();
for (Class<?> c : classes) {
if (c.getName().contains("PopupHandler")) {
// get declared methods
Method[] methods = c.getDeclaredMethods();
for (Method m : methods) {
if (m.getName().contains("hide")) {
m.setAccessible(true);
}
}
}
}
} catch (ClassNotFoundException e) {
e.printStackTrace();
} Also, I have investigated the NotificationPane component from controlsFx which wouldn't be ideal as the notification stays inside the application window. (most likely to be tab alike UI) I had the idea of adding |
We try to avoid reflection if possible and we are accepting tradeoffs, as in the veeeeery long run we wanted to play a bit with GraalVM around. |
I'm making this PR ready with the removal of the threshold notification because the notification timeout is 3 seconds which helps the notification to fade out and the new notifications are not restricted by the threshold notification. Few other findings:These are the few other works/ideas that I would like to document for future reference if anyone works on this.
|
Normally it should be sufficient to document your thoughts in this GitHub PR or in the corresponding issue, since the issue number should be recorded in the merge commit message. |
Alternatively you could maybe introduce a short paragraph in the development documentation. |
Is this ready-for-review? |
Yes @calixtus |
As this includes a ui change, can you please add a small note in the changelog? |
@calixtus Thanks, I have updated the changelog, and please let me know whether the note is fine. (I'm conflicted between added/fixed.) |
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 for your contribution!
* Refactor Snackbar to Notifications * Remove Threshold limit * Update Changelog * Fix style in changelog * Revert some changes in Changelog.md Co-authored-by: Yogeshvar Senthilkumar <[email protected]> Co-authored-by: Carl Christian Snethlage <[email protected]>
Thanks to @EduRibeiro00 & @X1nbb for documenting the findings and working on this issue. ❤️
Previous Discussion for Handling Multiple Messages: #7577 #7968
From the Snackbars Design Guidelines the frequency of the Snackbar should be only once at a time is recommended. I believe the implementation of https://github.com/sshahine/JFoenix/blob/2dbb8515da236140c41eabe22eb549b458f1e867/jfoenix/src/main/java/com/jfoenix/controls/JFXSnackbar.java#L321 is also based on that. The ideal choice to show Multiple Messages would be moving from Snackbar to Notifications (with custom CSS changes to replicate snack bar design)
Proposed Solution: Moving from Snackbar to Notifcations
Fixes #7340
notify.mp4
Few Open Questions while Implementation:
5
, as per the current draft PR. I have displayed a threshold notification that says"Too much happening... Hang on.."
Can someone suggest a better UX/message/way handle this, let's discuss.“Unable to make private void org.controlsfx.control.Notifications$NotificationPopupHandler.hide(javafx.stage.Popup,javafx.geometry.Pos) accessible: module org.controlsfx.controls does not "opens org.controlsfx.control" to module org.jabref”.
If someone suggests how to resolve this? I thought of removing the threshold notification and hiding the top of the stack with the help of this while inserting the next incoming notification.PR Checklist:
CHANGELOG.md
described in a way that is understandable for the average user (if applicable)