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 755158 - RoomList: Highlight roomlist header on hover, if roomlist header is sensitive
RoomList: Highlight roomlist header on hover, if roomlist header is sensitive
Status: RESOLVED FIXED
Product: polari
Classification: Applications
Component: general
3.17.x
Other Linux
: Normal normal
: ---
Assigned To: Polari maintainers
Polari maintainers
Depends on:
Blocks:
 
 
Reported: 2015-09-17 12:30 UTC by Bastian Ilsø
Modified: 2015-10-14 15:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
illustration of hover effect when hovering over a sensitive roomlist header (41.24 KB, image/png)
2015-09-17 12:30 UTC, Bastian Ilsø
  Details
Possible Patch for Header Highlight When Sensitive (911 bytes, patch)
2015-10-07 21:04 UTC, Cody Welsh
none Details | Review
Simplified previous patch, fixed differing margins at end of headers (1.82 KB, patch)
2015-10-07 22:11 UTC, Cody Welsh
reviewed Details | Review
ui: Highlight header on hover if sensitive (1.01 KB, patch)
2015-10-10 01:16 UTC, Cody Welsh
reviewed Details | Review
ui: Highlight header on hover if sensitive (893 bytes, patch)
2015-10-10 12:22 UTC, Cody Welsh
needs-work Details | Review
ui: Highlight header on hover if sensitive (964 bytes, patch)
2015-10-14 01:59 UTC, Cody Welsh
committed Details | Review
ui: Highlight room header while popover is shown (1010 bytes, patch)
2015-10-14 02:29 UTC, Florian Müllner
committed Details | Review

Description Bastian Ilsø 2015-09-17 12:30:45 UTC
Created attachment 311550 [details]
illustration of hover effect when hovering over a sensitive roomlist header

If you hover over a row in the roomList, the row is highlighted. When you hover over a sensitive roomlist header, it would be nice if the roomlist header also was highlighted in similar fashion. This communicates better that the roomlist header is clickable.
Comment 1 Cody Welsh 2015-10-07 21:04:59 UTC
Created attachment 312855 [details] [review]
Possible Patch for Header Highlight When Sensitive

add class to room-list-header on connect error; add css for connect-error class on hover
Comment 2 Cody Welsh 2015-10-07 22:11:23 UTC
Created attachment 312859 [details] [review]
Simplified previous patch, fixed differing margins at end of headers

fmuellner made me aware of not actually needing to add a class, so I fixed that. Also let me know about how to fix the header margins, so I bundled it in.
Comment 3 Florian Müllner 2015-10-07 22:51:42 UTC
Review of attachment 312859 [details] [review]:

The change looks mostly good to me, though I'll leave the final judgment on the details to Bastian.

Regarding the commit message, it should try to follow this template:

"optionalPrefix: Concisely describe what the patch does

Outline briefly why the change is done, and if necessary explain aspects of the
change that are not obvious from the code."


So in this case something like:
"ui: Highlight header on hover if sensitive

In case of account errors, room headers become clickable, but we currently 
don't convey that to the user. So highlight sensitive headers on hovers
to make this more obvious."

::: data/resources/application.css
@@ +47,3 @@
 }
 
+.polari-room-list .room-list-header:hover {

Does it make sense to add
 ".room-list-header:checked"
as well to use the same highlight while the popover is shown?

::: data/resources/room-list-header.ui
@@ -3,3 @@
   <template class="Gjs_RoomListHeader" parent="GtkMenuButton">
-    <property name="popover">errorPopover</property>
-    <property name="margin-bottom">4</property>

Not sure about moving the bottom padding - it moves the whitespace from below the border above, which disconnects the header text from its underline.
Comment 4 Bastian Ilsø 2015-10-09 23:37:18 UTC
Review of attachment 312859 [details] [review]:

Nice work! I have a few visual corrections:

1) it would be better to reuse the same color as the other rows. if you add the style classes "activatable" and "list-row" to the roomlistheader object you should be able to achieve that (you can also try doing this from GTK+ Inspector).
2) I dont think there's a need to change the padding as you did in the patch. Also because it changes the way the underline is rendered.

That should give you a result more closely resembling the screenshot I attached.
Comment 5 Cody Welsh 2015-10-10 01:14:40 UTC
Okay, cool. I'll post a new patch with the above in mind. :)
Comment 6 Cody Welsh 2015-10-10 01:16:25 UTC
Created attachment 313002 [details] [review]
ui: Highlight header on hover if sensitive

If there is a connection error, there is no user input.
Highlight headers upon hovering, as is done with room rows,
to indicate they are clickable.
Comment 7 Bastian Ilsø 2015-10-10 09:18:56 UTC
Review of attachment 313002 [details] [review]:

Two more nits :-)

> diff --git a/src/lib/.dirstamp b/src/lib/.dirstamp
> new file mode 100644
> index 0000000..e69de29
This file should not be included in the patch.

> If there is a connection error, there is no user input.
I dont make much out of this sentence, please see Florian's suggestion in Comment 3.
Comment 8 Cody Welsh 2015-10-10 12:12:24 UTC
Ha, I didn't even notice that file. Whoops.

Yeah, I should probably not write commit messages at early hours :)
Comment 9 Cody Welsh 2015-10-10 12:22:36 UTC
Created attachment 313016 [details] [review]
ui: Highlight header on hover if sensitive

In case of account errors, room headers become clickable, but we currently 
don't convey that to the user. So highlight sensitive headers on hovers
to make this more obvious.
Comment 10 Florian Müllner 2015-10-13 23:21:02 UTC
Review of attachment 313016 [details] [review]:

See comment below - also the commit message shown in comment #9 is missing from the actual patch.

Bastian, do we want to add a style when the popover is up as well (i.e. :checked)?

::: src/roomList.js
@@ +202,3 @@
             child = 'error';
+            this.get_style_context().add_class('list-row');
+            this.get_style_context().add_class('activatable');

Adding this each time there is an error is ugly, even though GTK+ handles this and doesn't add a duplicated style class. As a rule of thumb, every conditional add_class() should be matched by a remove_class(), and where removing a class doesn't make sense (as in this case), it should be added unconditionally - the template file[0] is a good place for that.

[0] https://git.gnome.org/browse/polari/tree/data/resources/room-list-header.ui#n10
Comment 11 Cody Welsh 2015-10-14 01:35:18 UTC
Yeah, that's a fair point - but where would one add that class? Looking at the GtkBuilder docs (I assume that's what I'm supposed to be looking at), I appear to be confusing myself a bit. Does Polari define custom tags such as <packing>? Or, are you implying you wish to add more class names in the initial <style> tag?
Comment 12 Florian Müllner 2015-10-14 01:45:50 UTC
(In reply to Cody Welsh from comment #11)
> Or, are you implying you wish to add more class names in the
> initial <style> tag?

That - we already add the 'room-list-header' class there, so it makes sense to use the same place to add 'list-row' and 'activatable'.
Comment 13 Cody Welsh 2015-10-14 01:59:28 UTC
Created attachment 313233 [details] [review]
ui: Highlight header on hover if sensitive

In case of account errors, room headers become clickable, but we currently
don't convey that to the user. So highlight sensitive headers on hovers
to make this more obvious.
Comment 14 Cody Welsh 2015-10-14 01:59:58 UTC
Okay, hopefully I did not get rid of the commit, this time. :)
Comment 15 Florian Müllner 2015-10-14 02:09:08 UTC
Attachment 313233 [details] pushed as 010fd09 - ui: Highlight header on hover if sensitive

That one's fine, thanks!
Comment 16 Florian Müllner 2015-10-14 02:29:14 UTC
Created attachment 313235 [details] [review]
ui: Highlight room header while popover is shown

Commit 010fd09 added a hover highlight to indicate that the header
is interactive, however this does not help to visually root the
popover when shown - add a separate style when the header is toggled
for that purpose.

... so here's the :checked state in case we want this as well.
Comment 17 Bastian Ilsø 2015-10-14 05:33:17 UTC
(In reply to Florian Müllner from comment #10)
> Bastian, do we want to add a style when the popover is up as well (i.e.
> :checked)?

Definitely a good idea (that would make the behavior consistent with other buttons in the UI).
Comment 18 Florian Müllner 2015-10-14 15:58:20 UTC
Attachment 313235 [details] pushed as d6fa2eb - ui: Highlight room header while popover is shown