Skip to content

gui: Added conn status icons to Remote Devices (fixes #8244) - #8553

Merged
calmh merged 14 commits into
syncthing:mainfrom
er-pa:enhancement/RemoteDevices
Sep 30, 2022
Merged

calmh merged 14 commits into
syncthing:mainfrom
er-pa:enhancement/RemoteDevices

Conversation

@er-pa

@er-pa er-pa commented Sep 23, 2022 •

Copy link
Copy Markdown
Member

Implementation proposal of the discussed enhancement in #8244

In short:
Depending on the connection type we add an icon before the device-status in the Remote Device panel. This should make it easier to notice if/when we use an inferior connection-type (f.e. Relay).

One can argue about what connection types deserve an 'own' icon, but also considering the amount of icons that are available in the same style from a default library (without needing to tweak them ourselves) I simply agreed with the latest comments from the issue, so from "worst" to "best":

1 - Relay
2 - QUIC
3 - TCP WAN
4 - TCP LAN

Screenshot 2022-09-23 at 14 36 33

The icons used are default reception icons from the bootstrap library (1-4 respectively). This icon-library was added.

The tooltip has been made somewhat interactive to add a direct link to the relevant document-page and sub-part. To accomplish this I added a delay of 1000ms before the tooltip disappears, this should give some time to click on the '?'-icon. Other than linking to the docs, this tooltip gives a brief description in a style of "Connection type: [type]" where "Connection type" is translatable, whereas the types currently aren't (apart from 'Relay', not sure whether it can be properly translated actually - I'm open to input). Reason being that the other connection types are, afaik, internationally known abbreviations. both parts are translatable.

Testing

Testing it is quite simple. Add some remote devices, preferable with different connection types.

Screenshots

An example of how it now looks:
Screenshot 2022-09-23 at 13 57 43

Documentation

I will adjust the documentation when the implementation is approved.

This can quite simply be a brief explanation of what these icons mean, what they don't mean and a visualisation of the four possible states (icons) with a short description of the meaning of each of them.

@er-pa
er-pa requested a review from calmh September 23, 2022 12:49
@tomasz1986

tomasz1986 commented Sep 23, 2022 •

Copy link
Copy Markdown
Member

I've done a very brief local test. Just a few comments - please feel free to address them if needed.

  1. The indicators look nice. Just wondering, as I haven't tested this, but wouldn't it be possible to achieve a similar effect without importing a whole new set of icons, and just use the already present https://forkaweso.me/Fork-Awesome/icon/signal instead? Unfortunately, the Fork Awesome icon hasn't got different variants, but could we perhaps simply hide (clip) the unneeded bars with CSS and re-use the exact same icon in all places?

  2. The icon does probably need to be placed in the title bar to be easily accessible, but have you tested what happens with very long device names (and possibly other languages that use much longer descriptions than English)? Does the icon overlap with the text? Is it still visible then? The same applies when using the GUI on a small (e.g. phone) screen.

  3. The tooltip pops up immediately when you click on the title bar simply wanting to unfold device details, which can be quite annoying. An alternative approach here could be to just add a new entry called "Connection Type" in the folder info and put all the information there. The tooltip wouldn't be needed anymore then.

Other than linking to the docs, this tooltip gives a brief description in a style of "Connection type: [type]" where "Connection type" is translatable, whereas the types currently aren't (apart from 'Relay', not sure whether it can be properly translated actually - I'm open to input). Reason being that the other connection types are, afaik, internationally known abbreviations.

I think all of them should be translatable actually. "Relay" is no question, as "relaying" is already translated in the GUI. When it comes to LAN, WAN, etc., the common perception may be so, but in reality they also use very different names, especially in languages that don't use the Latin alphabet, e.g. LAN is "局域网" in Chinese.

@er-pa

er-pa commented Sep 23, 2022

Copy link
Copy Markdown
Member Author

1.) That's worth a try, surely would save an otherwise unnecessary import. Looking into this.

2.) Long names is at least not a problem, it works the same as it did before; the name just get clipped off before the icon (endofthename...). A smaller GUI on f.e. a mobile device will "hide" the connection status, which was mostly intentional. But this is mostly just a choice, it can obviously be placed so that it will be showing in smaller screens too. Not entirely sure if it's important enough to show on smaller screens.

3.) I actually haven't had this happen myself, so that's quite interesting and worth a second look at. Putting it in the folder info would also be a possibility, but I have a feeling that it will be overlooked there.

And the translations is a valid point.

@tomasz1986

tomasz1986 commented Sep 23, 2022 •

Copy link
Copy Markdown
Member

Thank you for a very quick answer 🙂.

A smaller GUI on f.e. a mobile device will "hide" the connection status, which was mostly intentional. But this is mostly just a choice, it can obviously be placed so that it will be showing in smaller screens too. Not entirely sure if it's important enough to show on smaller screens.

I'd like to see it on mobile personally, but the fact is that there's already very little space there, so it may not be the best idea if doing so would truncate device name completely. However, does this mean that the whole "connection type" information is unavailable on mobile then? If yes, then I think this could yet be another argument for simply moving it to the device info.

3.) I actually haven't had this happen myself, so that's quite interesting and worth a second look at.

This is what it looks for me. The browser is Chromium.

image

@bt90

bt90 commented Sep 23, 2022

Copy link
Copy Markdown
Contributor

Is there a particular reason not add a new row? The type of connection and its rating is IMHO a rather crucial information and arguably easier to grasp for most users than looking at the IP address and its mouseover.

This would improve the situation on smaller screens as we don't have to cram all the information and the doc link into a mouseover.

@er-pa

er-pa commented Sep 23, 2022 •

Copy link
Copy Markdown
Member Author

Mostly because for many who already know a thing or two about it, it would be kind of duplicate with the information available under Address - either directly since it's clear from the IP or via the tooltip. It would be quite overkill, at least to me, to add an entire row to basically explain what that icon is doing there. And the ones who don't know about it - have little use for that row anyways.

At least I don't see the average user start a debugging-session to figure out why they are using QUIC instead of TCP. As I understood it, it's mostly to quickly view the status without having to dive into the device details.

But if the consensus is that an additional row adds enough value, then I'm not against it either.

P.s. I at least changed it so that it's visible on a mobile screen - doesn't seem too troublesome on my S21 FE. Does require a little more testing still.

P.p.s. The Icon clipping I'm really not a fan of. I don't think it looks that well in that way. But it's possible

@tomasz1986

tomasz1986 commented Sep 23, 2022 •

Copy link
Copy Markdown
Member

To be honest, neither the address alone nor specific connection types by themselves mean anything to the average non-technical person.

How about naming it "Connection Quality" instead, and then use simple and easily to understand words like "Excellent", "Good", "Average", and "Bad"? This would make it accessible to everyone. You could even combine both together, i.e. Excellent (TCP LAN), Good (TCP WAN), Average (QUIC), and Bad (Relay). This could be translated using variables, e.g. Excellent (%connectiontype%), etc. to avoid using single words and to make the context clear.

P.p.s. The Icon clipping I'm really not a fan of. I don't think it looks that well in that way. But it's possible

Yeah, thank you for trying. I hand't tested this myself, so I didn't really know whether the icons would look acceptable modified that way.

@er-pa

er-pa commented Sep 23, 2022

Copy link
Copy Markdown
Member Author

To be honest, neither the address alone nor specific connection types by themselves mean anything to the average non-technical person.

How about naming it "Connection Quality" instead, and then use simple and easily to understand words like "Excellent", "Good", "Average", and "Bad"? This would make it accessible to everyone. You could even combine both together, i.e. Excellent (TCP LAN), Good (TCP WAN), Average (QUIC), and Bad (Relay).

This is an acceptable option. However, I wouldn't say that for example "relay" is bad. Just the least favoured option in case there are alternatives available. We don't want users to panic either when they are connected to a relay :)

@tomasz1986

tomasz1986 commented Sep 23, 2022 •

Copy link
Copy Markdown
Member

Oh yes, you could tweak the terminology, of course 😉. Maybe just "Excellent", "Very good", "Good", and "Average"? Although, to be fair, I think "bad" kind of plays well with the single bar icon…

@acolomb

acolomb commented Sep 23, 2022

Copy link
Copy Markdown
Member

I like the icon idea in general, very nice and also very useful to see it without expanding. On small screens, the device status is already reduced to an icon, so the second icon should still fit reasonably.

Why not combine this with the address row in the details? AFAIR it doesn't show the connection type for connected devices currently? You can just append the text version (TCP LAN for example) in parentheses behind the current address. We don't need to repeat the icon there, just put a link to a suitable docs page in that row.

I'm not a fan of the extensive popover. Better just explain the symbol meaning in the docs page linked from the details row. It's something each user needs to learn only once if interested, not every time the mouse hovers over this thing.

@acolomb

acolomb commented Sep 23, 2022

Copy link
Copy Markdown
Member

Wouldn't it look cleaner to put the icon on the far right end? It's always the same width, while the device status (right aligned) can have different lengths, making the icon jump around.

@acolomb acolomb changed the title gui: Added conn status icons to Remote Devices (#8244) gui: Added conn status icons to Remote Devices (fixes #8244) Sep 23, 2022
@acolomb acolomb linked an issue Sep 23, 2022 that may be closed by this pull request
@er-pa

er-pa commented Sep 23, 2022

Copy link
Copy Markdown
Member Author

Wouldn't it look cleaner to put the icon on the far right end? It's always the same width, while the device status (right aligned) can have different lengths, making the icon jump around.

Potentially. The only 'downpart' is that Disconnected devices currently don't have a status-icon. Either that's acceptable or we could add the reception-0 icon as placeholder (which would be redundant) - if we take this approach at least.

@bt90

bt90 commented Sep 23, 2022

Copy link
Copy Markdown
Contributor

Isn't the address row already pretty crowded? e.g an IPv6 with a five digit port

I would also support moving the icon to the far right. Maybe we should add an icon for disconnected devices for consistency. We already show a simple offline/online icon on small screens. Maybe we should reuse the offline one and add also keep the green and purple color tones.

Screenshot_20220923-194746.png

@tomasz1986

tomasz1986 commented Sep 23, 2022 •

Copy link
Copy Markdown
Member

This is just a quick mock-up, but how about merging everything into a single entry like this?

image

The problem here is that this can potentially become quite lengthy. On the other hand, as already mentioned above, just "TCP LAN" (with the address next to it or not) is meaningless to the average user.

@er-pa

er-pa commented Sep 23, 2022

Copy link
Copy Markdown
Member Author

This is just a quick mock-up, but how about merging everything into a single entry like this?

Works for IPv4, but v6 will get messy that way. I'm not so sure about that part yet.

Also for the alignment of the icons; a quick "fix":
Screenshot 2022-09-23 at 19 24 03
Screenshot 2022-09-23 at 19 24 10

I don't think copying the color of the online-status would add much, but that wouldn't be a problem if that's what's preferred.

@bt90

bt90 commented Sep 23, 2022

Copy link
Copy Markdown
Contributor

Could we drop the checkmark and use green bars instead? Using both is a bit redundant.

Green bars 1-4 for an online device and the purple one for offline devices.

@uok

uok commented Sep 24, 2022

Copy link
Copy Markdown
Contributor

I'm against having this icon in the header. If transfer speeds are not as expected, the user can get more information on (quality of) connection by expanding the device section

@acolomb

acolomb commented Sep 24, 2022

Copy link
Copy Markdown
Member

There is certainly value in seeing it at a glance without drilling down. If "transfer speeds are not as expected", you will likely notice just in that one moment where you need to catch a train and find the sync not finished as expected with half an hour still to go. Seeing that a relay is (erroneously) involved right away, helps set the expectations right and gives a chance to act upon it. In the linked issue, there seemed to be a clear consensus to show it at top level and quick to grasp with a very simple icon.

@uok

uok commented Sep 25, 2022 •

Copy link
Copy Markdown
Contributor

I disagree! The connection type usually does not change that often (or most times not at all) to justify an extra icon in the header.
Maybe Syncthing could track if connection type changes from last time? Otherwise no icon is displayed.
e.g. normal use: "TCP" -> something changes: "relay" -> show icon

Other ideas
only have two states: TCP/QUIC (no icon) and relay (show icon)
only show icon while syncing

@tomasz1986

tomasz1986 commented Sep 25, 2022 •

Copy link
Copy Markdown
Member

Not sure about the others, but displaying the icon all the time would be useful for me to quickly diagnose whether all devices are connected in the way that they are supposed to be (and not, for example, use a relay when they all are located in the same network). Yes, you can unfold each of them and check the connection type manually, but this becomes tiresome very quickly with a larger number of devices.

Showing the icon only for specific (i.e. worse) types of connection is a possibility, but then it would probably need to be a different icon than the proposed signal one…

Showing it only during syncing would likely end up with bad user experience though, as the icon would appear and disappear constantly, e.g. when the transfer is bursty, which is common on slow/unstable connections, or simply when files are regularly updated every few seconds or so.

@bt90

bt90 commented Sep 25, 2022

Copy link
Copy Markdown
Contributor

Checking the connection type is the most basic troubleshooting step for slow transfer speeds. I stopped counting the number of times i had to explain this in the forum.

"It's very easy to find! Just open up the device information, locate the address row and wait for the mouseover to appear."

Oh, and of course I have to explain for the thousandth time what kind of connection is considered good/bad.

@imsodin

imsodin commented Sep 26, 2022

Copy link
Copy Markdown
Member

Thanks a lot for this contribution @er-pa !

Good discussion here, I'd just like to drop two things here: Lets try to not bike-shed to the point of straining @er-pa's time too much, and focus on getting to a decision (with weight given to the creator of the solution). And try to keep things simple and non-magic (like dis/appearing icons based on opaque rules).

@uok

uok commented Sep 26, 2022 •

Copy link
Copy Markdown
Contributor

Maybe just e.g. a snail icon for slow (= relay) connections? My suggestions are because users only ask for help / complain if a) something does not work or b) it is slow. Otherwise they don't care about TCP, QUIC, etc. and probably don't know.

@bt90

bt90 commented Sep 26, 2022

Copy link
Copy Markdown
Contributor

I don't see why we should only cover a single case if we can provide a rating for each connection type? What is the purpose of hiding this crucial information from the user?

We already have show online/offline for small screens. This would only add more granularity. And for larger screens it's even simpler as we have enough space?

@tomasz1986

tomasz1986 commented Sep 29, 2022 •

Copy link
Copy Markdown
Member

I've tested the current state. Not sure if this is the final version or still work in progress, but here are my observations/comments. As previously, please feel free to address them if necessary.

  1. Would it be possible to use less cryptic names for CSS classes? At the moment, it's impossible to deduct what they mean without reading the comments.

  2. Similarly, is it necessary to use numbers instead of actual names in JS/HTML? What I mean is, would it be possible to use ng-switch-when="quic" instead of the current ng-switch-when="2"? The reason is same as above, i.e. it is impossible to know which is which when looking at the HTML alone, without reading into the JS code.

  3. CSS masking seems still experimental and lacks support for older browsers. Is this the only way to use these SVG files as they are? The icons don't work in Internet Explorer, which is probably understandable, but do they work in older versions of WebKit/Blink? This is important when it comes to the Android app, which uses the built-in WebView engine to display the Web GUI, and that engine is often heavily out of date (since it used to be tied to a specific Android version and basically never updated).

    I haven't tested this myself, but I did find comments in the Internet stating that trying to use masking with WebView ended in displaying just black squares instead of the desired icons.

  4. Is the tooltip still necessary when there is a specific entry for "Connection Type" in the device info now?

  5. Is the help link to the Docs really necessary (especially with the explanatory tooltips)? No other entries in the folder/device info have such links next to them, so it kind of feels out of place there.

  • There seems to be some graphic glitch around the tooltip, so let's simplify that to the same kind of tooltip that we use everywhere else and skip the documentation link if that's problematic...

It's not that there are "glitches", but as things are right now, the tooltip is placed inside the device title bar, which itself is an interactive element. This means that clicking the title bar while placing the mouse over the icon at the same time will both unfold device info and display the tooltip, which just doesn't feel right in terms of user experience, at least for me.

@er-pa

er-pa commented Sep 30, 2022 •

Copy link
Copy Markdown
Member Author

I've tested the current state. Not sure if this is the final version or still work in progress, but here are my observations/comments. As previously, please feel free to address them if necessary.

I was still working on it, but thanks for your feedback either way ^^.

  1. Would it be possible to use less cryptic names for CSS classes? At the moment, it's impossible to deduct what they mean without reading the comments.

Yep, once it's all rounded up I'll clean that up.

  1. Similarly, is it necessary to use numbers instead of actual names in JS/HTML? What I mean is, would it be possible to use ng-switch-when="quic" instead of the current ng-switch-when="2"? The reason is same as above, i.e. it is impossible to know which is which when looking at the HTML alone, without reading into the JS code.

No, it's not necessary. I'm just not a fan of using string-like attributes in that way, esp not while testing. But, I can clean this up when finalising it.

  1. CSS masking seems still experimental and lacks support for older browsers. Is this the only way to use these SVG files as they are? The icons don't work in Internet Explorer, which is probably understandable, but do they work in older versions of WebKit/Blink? This is important when it comes to the Android app, which uses the built-in WebView engine to display the Web GUI, and that engine is often heavily out of date (since it used to be tied to a specific Android version and basically never updated).

Well, is it the only way? Probably not, just one that I knew of. But there are a couple things to consider:

1.) We didn't prefer to include the entire bootstrap icon library, which is understandable for only 5 icons.
2.) The ForkAwesome library seems to be, as stated by someone else already, inactive. This impacts the ability to rebuild it yourself without adjusting the process (and then, will that work?), it seems to rely on out-dated dependencies.
3.) We have several themes to support, so we do need some method to override the color of the svg. Black on grey is a no-no.

If there are much better ways to accomplish this, do tell. I still have to test it on older devices and other browsers (Edit: Seems to work fine on a stock-browser down in a Lollipop environment).

  1. Is the tooltip still necessary when there is a specific entry for "Connection Type" in the device info now?
  2. Is the help link to the Docs really necessary (especially with the explanatory tooltips)? No other entries in the folder/device info have such links next to them, so it kind of feels out of place there.

Potentially not, I will probably remove them.

@uok

uok commented Sep 30, 2022

Copy link
Copy Markdown
Contributor

If you want to avoid importing an extra svg you could use css to draw the bars. Then you can style them like you want

@tomasz1986

Copy link
Copy Markdown
Member

Well, is it the only way? Probably not, just one that I knew of. But there are a couple things to consider:

1.) We didn't prefer to include the entire bootstrap icon library, which is understandable for only 5 icons. 2.) The ForkAwesome library seems to be, as stated by someone else already, inactive. This impacts the ability to rebuild it yourself without adjusting the process (and then, will that work?), it seems to rely on out-dated dependencies. 3.) We have several themes to support, so we do need some method to override the color of the svg. Black on grey is a no-no.

If there are much better ways to accomplish this, do tell. I still have to test it on older devices and other browsers (Edit: Seems to work fine on a stock-browser down in a Lollipop environment).

Not necessarily "better" per se, but I've managed to make it work using the following code.

overrides.css:

/* Remote Devices connection-quality indicator */
.reception-0 {
    background: url('../../vendor/bootstrap/fonts/reception-0.svg') no-repeat;
}

.reception-1 {
    background: url('../../vendor/bootstrap/fonts/reception-1.svg') no-repeat;
}

.reception-2 {
    background: url('../../vendor/bootstrap/fonts/reception-2.svg') no-repeat;
}

.reception-3 {
    background: url('../../vendor/bootstrap/fonts/reception-3.svg') no-repeat;
}

.reception-4 {
    background: url('../../vendor/bootstrap/fonts/reception-4.svg') no-repeat;
}

default theme

/* Remote Devices 'connection type'-icon color set to #333 */
.reception {
    filter: invert(12%) sepia(11%) saturate(20%) hue-rotate(318deg) brightness(100%) contrast(80%);
}

dark and black themes

/* Remote Devices 'connection type'-icon color set to #aaa */
.reception {
    filter: invert(77%) sepia(0%) saturate(724%) hue-rotate(146deg) brightness(91%) contrast(85%);
}

I used the method from https://stackoverflow.com/questions/22252472/how-to-change-the-color-of-an-svg-element/53336754#53336754 to calculate the filter values. The advantage is that background is supported in all browsers, so the icon will always be displayed. The caveat is that if the browser doesn't support filter, the icon will end up being just black. I think this is still better than seeing a black square in its place 🙂 (which is the case with mask).

@er-pa

er-pa commented Sep 30, 2022 •

Copy link
Copy Markdown
Member Author

If the only caveat using that method is that the icon simply doesn't recolour when it's not supported, then it surely beats a possible edge-case where it becomes a black square - even though I haven't been able to get there - yet; someone probably will.

Seems like a solid alternative.

@tomasz1986

tomasz1986 commented Sep 30, 2022 •

Copy link
Copy Markdown
Member

Apart from some minor fixes, everything looks fine for me. I actually like the icons a lot 🙂.

Edit: The only other problem that I can think of, and which has been discussed previously, is that the average user still won't be able to understand the difference between all the different connection types, and why, for example, TCP LAN is better than QUIC, etc. without reading the docs. This may be something to address in a different commit though.

@calmh

calmh commented Sep 30, 2022

Copy link
Copy Markdown
Member

Yes, I think so. This is enough to maybe trigger the thought process to investigate it, I'm happy enough with that.

@bt90

bt90 commented Sep 30, 2022

Copy link
Copy Markdown
Contributor

Any screenshots of the current state?

@calmh

calmh commented Sep 30, 2022

Copy link
Copy Markdown
Member

Screenshot 2022-09-30 at 18 14 17

@calmh
calmh merged commit fd0a622 into syncthing:main Sep 30, 2022
calmh added a commit to calmh/syncthing that referenced this pull request Oct 3, 2022
* main:
  docker: Fix handling of PCAP variable (fixes syncthing#8567)
  cmd/stcrashreceiver: Update to more modern panicparse (syncthing#8566)
  cmd/strelaysrv: Add optional auth token (fixes syncthing#3987) (syncthing#8561)
  lib/fs: Skip xattrs test on EOPNOTSUPP (fixes syncthing#8564) (syncthing#8565)
  gui: Add connection status icons to Remote Devices (fixes syncthing#8244) (syncthing#8553)
@calmh calmh added this to the v1.22.1 milestone Oct 17, 2022
@er-pa
er-pa deleted the enhancement/RemoteDevices branch March 10, 2023 19:10
@st-review st-review added the frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion label Oct 12, 2023
@syncthing syncthing locked and limited conversation to collaborators Oct 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Show connection type in Remote Devices

8 participants