Bug 346458

Summary: Persistent notification body can be too long that make no new notification text shown in popup
Product: [Plasma] plasmashell Reporter: Weng Xuetian <wengxt>
Component: NotificationsAssignee: Martin Klapetek <mklapetek>
Status: RESOLVED FIXED    
Severity: normal CC: aleixpol, kde, plasma-bugs, thomas.pfeiffer
Priority: NOR Flags: aleixpol: Usability+
Version: 5.2.95   
Target Milestone: 1.0   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In: 5.16.0

Description Weng Xuetian 2015-04-22 06:12:03 UTC
It's common when using ktp and you missed more than 3 messages.

Since the notification is persistent, the popup will only show first three line of them.
It would be better if it shows last three line of the message.

Reproducible: Always

Steps to Reproduce:
Run
notify-send "a" "b"
notify-send "a" "c"
notify-send "a" "d"
notify-send "a" "e"

Actual Results:  
Only b, c, d are shown.

Expected Results:  
c, d, e are shown.
Comment 1 Martin Klapetek 2015-04-22 08:37:43 UTC
I'd like to make it even smarter and make it say

"2 previous notifications
d
e"

...but string freeze, so 5.4.
Comment 2 Martin Klapetek 2015-04-22 08:41:37 UTC
For 5.3 it could still show just the last messages with "..." at the beginning, but I'm on the edge here. I'm not sure if it's better to show the first messages as much as they fit or the last messages (the latter is certainly harder to do).

Thomas - what do you think? If you receive 4 messages, in the notification popup show

"First message
Second message
Third message..."

or

"...
Third message
Fourth message"

?
Comment 3 Weng Xuetian 2015-04-22 16:25:09 UTC
Actually I was wonder if it can be in reverse order.
Third message
Second message
First meesage

Because every message can actually longer than three line. Show last 3 message may not solve the problem. And cut the whole string from end may cut a message from end. For example
-------------------------------
...
ThirdThirdThird
ThirdThirdThird
Fourth   (<-------- this line is not shown)
-------------------------------

Or, make popup always show the latest message, and the message list show the whole history.
Comment 4 Thomas Pfeiffer 2015-04-23 22:35:31 UTC
Thank you for informing me about this, Martin!

Okay, here's my take: The last message/notification is most likely to be the most relevant one for the user (regardless of the application), so I agree that it should not be truncated.

From a user's perspective, the best solution would probably be to only show as many messages as fit in the popup in full.

If it is not possible to determine how many of the last notifications fit into the popup, following the above reasoning (and agreeing with Martin that a truncation in the beginning is quite uncommon), I'd recommend showing only the latest notification (as Weng Xuetian suggested).
Comment 5 Kai Uwe Broulik 2015-04-25 20:20:19 UTC
+1 on reverse order, prepend new ones and older probably by now less relevant notifications just fall off at the bottom when the maximum line count is reached.
Comment 6 Kai Uwe Broulik 2019-05-09 09:47:09 UTC
Git commit 3c52fc3bc05e0f351d4998ad54edae1a4e21a043 by Kai Uwe Broulik.
Committed on 09/05/2019 at 09:29.
Pushed by broulik into branch 'master'.

Merge branch 'broulik/libnotificationmanager'

This includes:
libnotificationmanager https://phabricator.kde.org/D20265
New notification plasmoid: https://phabricator.kde.org/D20266
as well as dataengine compat: https://phabricator.kde.org/D20490 and https://phabricator.kde.org/D20491
Related: bug 222470, bug 402144, bug 405570, bug 391646, bug 401819, bug 400811, bug 392669, bug 390143, bug 390864, bug 374099, bug 360990, bug 398926, bug 390152, bug 342355, bug 402391, bug 399697, bug 400871, bug 398580
FIXED-IN: 5.16.0


https://commits.kde.org/plasma-workspace/3c52fc3bc05e0f351d4998ad54edae1a4e21a043