[Notifications] Introduce dedicated "read" state for notification

Authored by broulik on Sep 15 2019, 9:23 PM.



Currently, a notification is considered "unread" when it was created or updated after the last time the user opened the history.
To alleviate this, when the notification popup is hovered, e.g. because the user wanted to drag an image out, select some text, or open the "More" menu, it is considered read. It will still end up in the history but will not needlessly show the "unread notification" bell icon.

Moreover, job finished notifications are always considered read, as they are either from long-standing jobs which the user is likely aware of, or confirmation of short tasks the user doesn't need explicit confirmation about. For example, extracting an archive in Dolphin, I get an "Extracting (Finished)" but I don't want to explicitly acknowledge that notification because I can just enter the folder that was just created in Dolphin.

This surely doesn't fix the underlying problem of notification expiration and history, and the user might just interact wiht some tray icons or the clock and not actually deal with the notification popup but this is imho an acceptable stopgap until a proper solution is found, which won't happen in time for Plasma 5.17 anyway.

Test Plan
  • Took a screenshot, dragged notification out, let notification expire, didn't get a bell
  • Copied some files, got a finished notification, didn't get a bell
  • Copied some files, killed Dolphin, got a persistent error notification as before
  • Created four notifications, opened history, got four notifications expanded (all unread notifications are expanded by default)
  • Created two notifications, hovered them, created three more, opened history, got three notifications (the unread) shown, and "two more"

Diff Detail

R120 Plasma Workspace
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
broulik created this revision.Sep 15 2019, 9:23 PM
Restricted Application added a project: Plasma. · View Herald TranscriptSep 15 2019, 9:23 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
broulik requested review of this revision.Sep 15 2019, 9:23 PM
ngraham accepted this revision.Sep 15 2019, 9:44 PM
ngraham added a subscriber: ngraham.

Lovely, this is much nicer behavior!

This revision is now accepted and ready to land.Sep 15 2019, 9:44 PM
This revision was automatically updated to reflect the committed changes.