GNOME Bugzilla – Bug 608915
Ellipsization problems in message tray
Last modified: 2010-02-22 22:09:55 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.
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?
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.
(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.
Review of attachment 152963 [details] [review]: Looks good and works as expected. Can you please add a "why" line to the commit message.
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
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.)
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.)
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: '<$1>' }, I think it reads better to do <$1> even if the > isn't necessary - avoid an unbalance. @@ +79,3 @@ + summaryReplacement: '$2 <$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...
Attachment 153973 [details] pushed as d8800c0 - NotificationDaemon: add rewriteRules infrastructure, use it for xchat