After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 776157 - Improve notifications' interaction
Improve notifications' interaction
Status: RESOLVED FIXED
Product: gnome-music
Classification: Applications
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-music-maint
gnome-music-maint
: 754404 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2016-12-16 04:46 UTC by Georges Basile Stavracas Neto
Modified: 2017-02-18 15:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
window: Use a push/pop model for loading notifications (10.23 KB, patch)
2016-12-16 04:46 UTC, Georges Basile Stavracas Neto
none Details | Review
window: Use one notification widget for loading (3.89 KB, patch)
2016-12-16 04:46 UTC, Georges Basile Stavracas Neto
none Details | Review
window: Improve the playlist remove notification (7.07 KB, patch)
2016-12-16 04:47 UTC, Georges Basile Stavracas Neto
none Details | Review
project: Remove GdNotification from compiled libgd list (790 bytes, patch)
2016-12-16 04:47 UTC, Georges Basile Stavracas Neto
committed Details | Review
window: Use a push/pop model for loading notifications (10.24 KB, patch)
2016-12-21 20:30 UTC, Georges Basile Stavracas Neto
committed Details | Review
window: Use one notification widget for loading (3.93 KB, patch)
2016-12-21 20:31 UTC, Georges Basile Stavracas Neto
committed Details | Review
window: Improve the playlist remove notification (7.25 KB, patch)
2016-12-21 20:32 UTC, Georges Basile Stavracas Neto
committed Details | Review
window: Show loading notification after a small delay (2.02 KB, patch)
2016-12-21 22:24 UTC, Georges Basile Stavracas Neto
committed Details | Review

Description Georges Basile Stavracas Neto 2016-12-16 04:46:42 UTC
See the patches below
Comment 1 Georges Basile Stavracas Neto 2016-12-16 04:46:49 UTC
Created attachment 342049 [details] [review]
window: Use a push/pop model for loading notifications

The current loading notification is handled by a private function
that is accessed outside the Window object. This is not only a poor
design decision, as the notification object is an implementation
detail of the window, and external objects can't rely on that.

Fix that by hiding the loading notifications management behind a
push/pop pair of calls.
Comment 2 Georges Basile Stavracas Neto 2016-12-16 04:46:55 UTC
Created attachment 342050 [details] [review]
window: Use one notification widget for loading

Instead of instantiating the notification widget every time
we start a new loading notification, put a static one and only
show and hide it.

This patch also makes the loading notification a GtkRevealer
widget.
Comment 3 Georges Basile Stavracas Neto 2016-12-16 04:47:00 UTC
Created attachment 342051 [details] [review]
window: Improve the playlist remove notification

Following the previous patch, this patch turns the
playlist notification into a GtkRevealer, and reorganize
the code to better expose that.

Again, the notification was made an implementation
detail and the method was renamed to be public.
Comment 4 Georges Basile Stavracas Neto 2016-12-16 04:47:05 UTC
Created attachment 342052 [details] [review]
project: Remove GdNotification from compiled libgd list

We completely wiped out all the traces of GdNotification,
we can safely drop it now.
Comment 5 Marinus Schraal 2016-12-21 16:46:53 UTC
Review of attachment 342049 [details] [review]:

minor adjustments

::: gnomemusic/window.py
@@ +82,3 @@
         self.set_icon_name('gnome-music')
         self.notification_handler = None
+        self.loading_counter = 0

self._loading_counter

@@ +525,3 @@
+        """ Increases the counter of loading notification triggers running. If
+        there is no notification is visible, the loading notification is
+        started.

block comments and docstrings have line length at 72 chars (nitpicking i know)
Comment 6 Marinus Schraal 2016-12-21 16:53:15 UTC
Review of attachment 342050 [details] [review]:

lgtm

::: gnomemusic/window.py
@@ +112,3 @@
+    def _setup_loading_notification(self):
+        self.loading_notification = Gtk.Revealer(halign=Gtk.Align.CENTER,
+                                                 valign=Gtk.Align.START)

self._loading_notification
Comment 7 Marinus Schraal 2016-12-21 17:03:54 UTC
Review of attachment 342051 [details] [review]:

Why not stay in the terminology and push_playlist_notification?

::: gnomemusic/window.py
@@ +32,2 @@
 import gi
 gi.require_version('Gd', '1.0')

you can remove these 2 lines with Gd gone

I did notice however that at least 1 other module doesn't import it correctly itself (which was hidden by this one).

@@ +142,3 @@
+    @log
+    def _setup_playlist_notification(self):
+        self.playlist_notification_timeout_id = 0

self._playlist_notification_timeout_id

@@ +143,3 @@
+    def _setup_playlist_notification(self):
+        self.playlist_notification_timeout_id = 0
+        self.playlist_notification = Gtk.Revealer(halign=Gtk.Align.CENTER,

self._playlist_notification
Comment 8 Marinus Schraal 2016-12-21 17:04:28 UTC
Review of attachment 342052 [details] [review]:

lgtm
Comment 9 Marinus Schraal 2016-12-21 17:09:03 UTC
Awesome patches.

I don't think we should overthink at this time and the replacement of libgd is the important aspect.

Eventually we should maybe make a little notification class to get the code burden out of the window.py .

One small feature request I have is for the notifications (especially loading) to have a little grace time (0-100/200ms) where they can be pushed but don't get revealed yet. My feeling is that a lot of loading times are too fast they result in a reveal and immediate hide.
Comment 10 Georges Basile Stavracas Neto 2016-12-21 20:30:52 UTC
Created attachment 342349 [details] [review]
window: Use a push/pop model for loading notifications

Fixed.
Comment 11 Georges Basile Stavracas Neto 2016-12-21 20:31:09 UTC
Created attachment 342350 [details] [review]
window: Use one notification widget for loading

Fixed.
Comment 12 Georges Basile Stavracas Neto 2016-12-21 20:32:13 UTC
Created attachment 342351 [details] [review]
window: Improve the playlist remove notification

I didn't use the push/pop model because the Playlists notification
doesn't use it. We don't push playlists removal notification, just
show them.
Comment 13 Georges Basile Stavracas Neto 2016-12-21 22:24:23 UTC
Created attachment 342356 [details] [review]
window: Show loading notification after a small delay

When loading e.g. an artists, the notification can show and
hide very quickly, causing a very bad impression since we didn't
really spend any time loading it.

Fix that by setting a small timeout of 500ms before showing
the notification.
Comment 14 Marinus Schraal 2016-12-31 12:51:39 UTC
Pushed with some minor stylistic modifications & cleanups. Thanks for 
the patches!

Attachment 342349 [details] pushed as b8da571 - window: Use a push/pop model for loading notifications
Attachment 342350 [details] pushed as 1f7a335 - window: Use one notification widget for loading
Attachment 342351 [details] pushed as b1c9ce4 - window: Improve the playlist remove notification
Attachment 342356 [details] pushed as 35f0393 - window: Show loading notification after a small delay
Comment 15 Marinus Schraal 2017-02-18 15:20:37 UTC
*** Bug 754404 has been marked as a duplicate of this bug. ***