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 775250 - mainWindow: Change contents of userList button to reflect the state of the room.
mainWindow: Change contents of userList button to reflect the state of the room.
Status: RESOLVED OBSOLETE
Product: polari
Classification: Applications
Component: general
3.23.x
Other Linux
: Normal normal
: ---
Assigned To: Polari maintainers
Polari maintainers
Depends on:
Blocks:
 
 
Reported: 2016-11-28 16:05 UTC by Bastian Ilsø
Modified: 2021-06-10 11:04 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
mockup showing the different user list states on the showUserListButton. (52.60 KB, image/png)
2016-11-28 16:05 UTC, Bastian Ilsø
  Details
patch for addition of spinner to user list button (8.10 KB, patch)
2017-09-10 12:43 UTC, Karuna Grewal
none Details | Review
patch for addition of spinner to user list button (8.16 KB, patch)
2017-09-13 21:32 UTC, Karuna Grewal
needs-work Details | Review

Description Bastian Ilsø 2016-11-28 16:05:49 UTC
Created attachment 340926 [details]
mockup showing the different user list states on the showUserListButton.

In Polari there is a button in the upper right corner labeled with a number which, when clicked shows the list of users in the current room. When you successfully joined a room with Polari, the "showUserListButton"'s label corresponds to the number of users in the selected room.

But there are other cases we need to handle:
 1) The button's should show a GtkSpinner while we are connecting to the room.
 2) If we encounter an error, the button should show the "dialog-error" icon.


To fix this bug you will need to create a GtkStack inside the button. The button should change whether to show the spinner, show the number of users or show the error icon depending on the current state of connecting to the room.
Comment 1 Bastian Ilsø 2016-11-28 16:06:17 UTC
Adding this as a 'newcomers' bug.
Comment 2 Karuna Grewal 2017-09-10 12:43:27 UTC
Created attachment 359459 [details] [review]
patch for addition of spinner to user list button

bastianilso please review this patch for any changes
Comment 3 Sendy 2017-09-11 17:21:11 UTC
Review of attachment 359459 [details] [review]:

Is it necessary to add empty line at `mainWindow.js:190` ?
Comment 4 Karuna Grewal 2017-09-11 17:24:08 UTC
(In reply to Sendy from comment #3)
> Review of attachment 359459 [details] [review] [review]:
> 
> Is it necessary to add empty line at `mainWindow.js:190` ?

I'm sorry i will remove it .
Comment 5 Karuna Grewal 2017-09-13 21:32:39 UTC
Created attachment 359744 [details] [review]
patch for addition of spinner to user list button

I have remove the blank line.
Comment 6 Florian Müllner 2017-09-17 13:09:42 UTC
Review of attachment 359744 [details] [review]:

I'm a bit worried about not handling errors, that is just keep spinning forever on failure. But it's early in the cycle, so we can look into this at a later point.

In addition to the comments below, the commit message shows up as:

From:  <À¿=îfU>
Subject: [PATCH] main-Window.ui,mainWindow.js : Change contents of

here. Can you please make sure to use UTF-8 to set the "author-name" and "author-email" git options? Also the prefix should denote the primary area of a change, not list all affected files (that information is already in the patch anyway). So use something like:

mainWindow: Indicate connection progress in user list button

::: data/resources/main-window.ui
@@ +167,3 @@
+                     <child>
+                       <object class="GtkToggleButton" id="showUserListButton">
+        -                <property name="visible">True</property>

Careful about invalid XML here (note the leading '-' character)

::: src/mainWindow.js
@@ -173,3 @@
-
-        this._updateUserListLabel();
-

Nit: Keep one of the empty lines

@@ -187,3 @@
                                   Lang.bind(this, this._updateDecorations));
         this._updateDecorations();
-

Stray whitespace change

@@ -204,3 @@
             this._updateUserListLabel();
         });
-

Dto.

@@ +370,3 @@
         dialog.show();
     },
+    _getConnectionStatus: function() {

Nit: Empty line between methods

@@ +378,3 @@
+    _onConnectionStatusChanged: function() {
+        let status = this._getConnectionStatus();        
+        if ( !this._room.channel)

This condition is wrong - if a network is offline/disconnected, then of course there won't be a channel. But showing a spinner in that case is wrong, because there is no connection of any kind in progress.

@@ +379,3 @@
+        let status = this._getConnectionStatus();        
+        if ( !this._room.channel)
+                    {this._iconStack.visible_child_name="connecting";

Please follow the style conventions - the whitespace, indentation and line breaks are completely messed up here.

This is how to write a condition with blocks of statements:

if (foo) {
    doStuff();
    doMoreStuff();
} else {
    doSomethingElse();
}

(if all blocks only consist of a single statement, braces should be omitted according to our coding style)

@@ +398,3 @@
                                       "%d users", numMembers).format(numMembers);
         this._showUserListButton.get_accessible().set_name(accessibleName);
+        this._label.set_text('%d'.format(numMembers));

What's the motivation for this change?

If you really need to track the label separately, please use a more descriptive name than 'label' - after all, the .ui file in question is the one for the entire window, which certainly contains much more than a single label :-)
Comment 7 André Klapper 2021-06-10 11:04:36 UTC
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org.
As part of that, we are mass-closing older open tickets in bugzilla.gnome.org
which have not seen updates for a longer time (resources are unfortunately
quite limited so not every ticket can get handled).

If you can still reproduce the situation described in this ticket in a recent
and supported software version of Polari, then please follow
  https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines
and create a new ticket at
  https://gitlab.gnome.org/GNOME/polari/-/issues/

Thank you for your understanding and your help.