DEV Community

Gary Kramlich
Gary Kramlich

Posted on • Originally published at patreon.com

Managing Notifications

This article was originally posted on Patreon and has been brought over here to get all of the Pidgin Development/History posts into one single place.

Historically Pidgin hasn't handled notifications in the most user friendly ways. They were tucked away in the bottom of the Buddy List window and there was actually two types, connection errors and authorization requests. The authorization requests could actually be used for more, but no one ever used that API.

Some other issues with it were that it isn't clear what account a connection error is from especially if you have the same username on multiple accounts. Also multiple notifications would stack with some tiny controls to navigate them which weren't usable via the keyboard.

A screen shot of notifications in pidgin 2

This all was usable enough, but for Pidgin 3 we wanted to do better. But in Pidgin 3 we've moved to a single window. This was a problem because the state of the notifications was stored by the user interface. In Pidgin's case, this meant it was in the Buddy List, so removing that window meant we had to move where that state was stored.

To do that we created the Notification Manager API. The Notification Manager API, as you might have guessed, manages Notifications. Since the notification state is now stored in libpurple, this means we were able to remove it from the Buddy List window and into the new single window design.

A screen shot of notifications in pidgin 3

As you can see is much easier to work with. It is sorted newest to oldest, the actions are easily accessible, the protocol icon helps you figure out which account the notification belongs to, and most importantly, keyboard navigation is supported!

We also added a bunch of helpers for creating notifications so that they will get used more. An example of this is server notifications. Historically we popped up a dialog for these which can be very annoying and very easy to accidentally dismiss as they would steal keyboard focus. But now these just go to the notification manager!

I hope you're enjoying these posts! Remember they go live for patrons at 9AM CST on Mondays and go public at 12AM CST on Thursdays! If you'd like to support my work, you can join find a list of ways to do so here.

Top comments (0)