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 608915 - Ellipsization problems in message tray
Ellipsization problems in message tray
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2010-02-03 19:19 UTC by Owen Taylor
Modified: 2010-02-22 22:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[MessageTray] fix ellipsization when the title is too long (1.64 KB, patch)
2010-02-03 20:17 UTC, Dan Winship
committed Details | Review
NotificationDaemon: add rewriteRules infrastructure, use it for xchat (2.27 KB, patch)
2010-02-16 22:35 UTC, Dan Winship
committed Details | Review

Description Owen Taylor 2010-02-03 19:19:39 UTC
With code from this morning (haven't updated for the very latest changes), I'm seeing:

 XChat: Private message from walters (_GimpNet): ...

That is, with the "..." literally there. On every private message. The total width is tiny compared ot the available width of the screen.
Comment 1 Dan Winship 2010-02-03 20:17:48 UTC
Created attachment 152963 [details] [review]
[MessageTray] fix ellipsization when the title is too long

OK, 3 problems:

  1. Default message tray max width is possibly too small. (It's
     currently screen_width/3.) This could change.

  2. If the title gets ellipsized, the start of the banner gets
     drawn outside the notification. FIxed by this patch.

  3. If the title gets ellipsized, there's no way to see the rest
     of it. I guess we could have it go onto multiple lines when the
     notification is popped out?
Comment 2 William Jon McCann 2010-02-03 21:02:49 UTC
I think in this case the banner (and probably the expanded) should look like:

[xchat icon] <b>walters</b> Can you review my patch?

which assumes private message

or possibly, as suggested by owen:
[xchat icon] <b>walters (#gnome-shell)</b> Can you review my patch?

for channel messages or whatever we call them.

I'm not sure we want to try to truncate or ellipsize the subject in general.  I probably makes sense to try to get the app to use something sensible.  And by that I mean easily "glanceable".

The banner should be able to be parsed in a momentary glance.  A long and complicated subject makes this harder.
Comment 3 Owen Taylor 2010-02-03 21:23:43 UTC
(In reply to comment #2)
> I'm not sure we want to try to truncate or ellipsize the subject in general.  I
> probably makes sense to try to get the app to use something sensible.  And by
> that I mean easily "glanceable".

It would make sense to me to hack in subject cleanup (via regex, say), for some of the most common Linux desktop apps so we show our vision up front, and don't have to try and convince the app maintainers to make changes before we start doing something reasonable.
Comment 4 Marina Zhurakhinskaya 2010-02-03 22:24:42 UTC
Review of attachment 152963 [details] [review]:

Looks good and works as expected. Can you please add a "why" line to the commit message.
Comment 5 Dan Winship 2010-02-04 00:22:52 UTC
Comment on attachment 152963 [details] [review]
[MessageTray] fix ellipsization when the title is too long

Attachment 152963 [details] pushed as f1fb0d3 - [MessageTray] fix ellipsization when the title is too long
Comment 6 Dan Winship 2010-02-16 22:35:10 UTC
Created attachment 153973 [details] [review]
NotificationDaemon: add rewriteRules infrastructure, use it for xchat

Changes notifications like:

    XChat: Private message from: danw (GimpNet) blah...

to

    danw: blah blah blah blah

(the "XChat" being unnecessary since there's already an xchat icon
there anyway.)
Comment 7 Dan Winship 2010-02-16 22:44:33 UTC
the specific replacements might need a little work. Right now you end up with (CAPS = bold):

regular channel message:

  [X] #CHANNEL <DANW> blah blah blah blah

highlighted channel message:

  [X] #CHANNEL <DANW> BLAH BLAH BLAH BLAH

private message:

  [X] <DANW> blah blah blah

(ie, channel messages are prefixed with the channel name, and highlighted messages boldify the whole body. it would be nice if we could boldify just the highlighted word in a highlighted message, but we don't know which word was supposed to have been highlighted.)
Comment 8 Owen Taylor 2010-02-22 20:35:36 UTC
Review of attachment 153973 [details] [review]:

Looks good to me and like it will improve the situation quite a bit for X-Chat; will most likely need additional tuning and apps later. Few minor comments:

::: js/ui/notificationDaemon.js
@@ +73,3 @@
+    'XChat': [
+        { summaryPattern:     /^XChat: Private message from: (.*) \(.*\)$/,
+          summaryReplacement: '&lt;$1>' },

I think it reads better to do &lt;$1&gt; even if the &gt; isn't necessary - avoid an unbalance.

@@ +79,3 @@
+          summaryReplacement: '$2 &lt;$1>',
+          bodyPattern:        /(.*)/,
+          bodyReplacement:    '<b>$1</b>' }

Hmm, from discussion on IRC, 'New public message from:' occurs if you have X-Chat notifying you on every channel message, which is basically an unlivable situation. So, my thought is that we don't need to distinguish 'Highlighted message from:' from that and can just display them both without bold. It would be neat to actually have the highlighted words, of course, but failing that...
Comment 9 Dan Winship 2010-02-22 22:09:52 UTC
Attachment 153973 [details] pushed as d8800c0 - NotificationDaemon: add rewriteRules infrastructure, use it for xchat