Add Direction column to Peers Tab #317

pull jarolrod wants to merge 1 commits into bitcoin-core:master from jarolrod:direction-col-peers changing 3 files +14 −2
  1. jarolrod commented at 8:03 am on May 5, 2021: member

    Picking up #289

    This adds a Direction column, making the peers tab the same as the Direction/Type row in the peer details and the direction and type columns in our other user-facing peer connections table in -netinfo.

    Users can now sort the peers table by direction. The default sort is set to inbound, then outbound.

    Master PR
    Screen Shot 2021-05-05 at 3 51 09 AM Screen Shot 2021-05-05 at 3 35 40 AM
  2. jarolrod renamed this:
    Direction col peers
    Peers Tab Direction Column
    on May 5, 2021
  3. in src/qt/peertablesortproxy.cpp:30 in be37e2385e outdated
    25@@ -26,6 +26,8 @@ bool PeerTableSortProxy::lessThan(const QModelIndex& left_index, const QModelInd
    26         return left_stats.nodeid < right_stats.nodeid;
    27     case PeerTableModel::Address:
    28         return left_stats.addrName.compare(right_stats.addrName) < 0;
    29+    case PeerTableModel::Direction:
    30+        return left_stats.fInbound > right_stats.fInbound; // default sort Inbound, then Outbound
    


    hebasto commented at 7:59 am on May 6, 2021:
    What does mean “default sort”?

    jarolrod commented at 3:49 am on May 26, 2021:
    addressed in 5d7463a

    jonatack commented at 12:46 pm on May 26, 2021:
    The sort direction when you first click to a column.
  4. in src/qt/guiutil.cpp:669 in a44eec9480 outdated
    665@@ -666,10 +666,12 @@ QString ConnectionTypeToQString(ConnectionType conn_type, bool prepend_direction
    666 {
    667     QString prefix;
    668     if (prepend_direction) {
    669+        //: Connection direction. Also used in CONNECTION_TYPE_DOC and PeerTableModel::data().
    


    hebasto commented at 10:03 pm on May 7, 2021:

    This translator comment will be assigned to the first string only, i.e., “Inbound”.

    We should add a translator comment to one string at a time (here and other places).


    jarolrod commented at 3:50 am on May 26, 2021:
    Will address in a follow-up PR which focuses on improving these translations. For now, the commit referenced here has been dropped to make the PR focused on just adding a new Direction column. See: #317 (comment)
  5. hebasto added the label UX on May 9, 2021
  6. promag commented at 1:40 pm on May 10, 2021: contributor
    No strong opinion, just think that with arrows it was more compact and clean.
  7. jonatack commented at 10:33 pm on May 10, 2021: contributor
    Currently, direction isn’t a sortable column, and it’s potentially confusing to users to display both connection direction and type in the details area but only the the connection type without the direction (and so no type at all for inbounds) in the main table. It was the reason I reopened the parent PR after an issue was filed in bitcoin/bitcoin where this came up.
  8. jarolrod force-pushed on May 26, 2021
  9. jarolrod commented at 3:47 am on May 26, 2021: member

    updated from a44eec9 -> 5d7463a (pr317.01, pr317.02, diff)

    Changes:

    • drop the last three commits (f4bde8c4067dd94fd53bf043934af8bc9a9b3ec6, 8090db4bbb47ec787918ca1e7f4a4a818b94fff5, a44eec94805dc523b8c7de638bb68f555cc63873) inherited from picking up #289 in order to make the PR focused on adding a Direction column. The work done in those commits will be picked up in another PR.
    • Now based on the last commit of #311 so that we are consistent with adding the new Direction column and the translator comment for it
    • Address #317 (review) by removing the (possibly confusing) comment
    • Fix translator comment for the Direction column in PeerTableModel::data
  10. in src/qt/peertablesortproxy.cpp:30 in 5d7463aec2 outdated
    25@@ -26,6 +26,8 @@ bool PeerTableSortProxy::lessThan(const QModelIndex& left_index, const QModelInd
    26         return left_stats.nodeid < right_stats.nodeid;
    27     case PeerTableModel::Address:
    28         return left_stats.addrName.compare(right_stats.addrName) < 0;
    29+    case PeerTableModel::Direction:
    30+        return left_stats.fInbound > right_stats.fInbound;
    


    jonatack commented at 12:44 pm on May 26, 2021:
    if you retouch, the comment at https://github.com/bitcoin-core/gui/pull/289/commits/678b57227e5c163cfbe77444d2c8b39c357678c2#diff-dafd60d44b87b3de8fc005415f63356de4fdd1fa772d1c1131a2c8b58c8b1d9aR30 seemed helpful to describe why > rather than < operator is used here, unlike the other columns

    jarolrod commented at 8:31 pm on May 26, 2021:
    Thanks for the review, Addressed in 0183415
  11. jonatack commented at 12:46 pm on May 26, 2021: contributor
    Light code review ACK 5d7463aec2c3a786af6aa724c417af16f8a787b6
  12. DrahtBot added the label Needs rebase on May 26, 2021
  13. jarolrod force-pushed on May 26, 2021
  14. jarolrod commented at 8:31 pm on May 26, 2021: member

    updated from 5d7463a -> 0183415 (pr317.02 -> pr317.03)

    Changes:

    • rebased over master due to conflict with #313
    • Addressed @jonatacks suggestion. For the purposes of clarity, reintroduce comment about ordering
  15. gui: add Direction column to peers tab
    Co-authored-by: Jarol Rodriguez <jarolrod@tutanota.com>
    6971e790c3
  16. jarolrod force-pushed on May 26, 2021
  17. jarolrod commented at 9:39 pm on May 26, 2021: member

    updated from 0183415 -> 6971e79 (pr317.03 -> pr317.04, diff)

    Changes:

    • rebase over conflict with #311 (drop commit from 311 this was based on)
  18. jonatack commented at 9:46 pm on May 26, 2021: contributor
    Tested ACK 6971e790c32253ecddb6108e796afd3892ced7fe
  19. DrahtBot removed the label Needs rebase on May 26, 2021
  20. jonatack commented at 1:32 pm on June 5, 2021: contributor
    @hebasto mind having a look into this? Would be nice to have it in v22.
  21. luke-jr commented at 8:59 pm on June 12, 2021: member
    This still takes up an annoying chunk of horizontal size. #363 ?
  22. jonatack commented at 9:28 pm on June 12, 2021: contributor

    This still takes up an annoying chunk of horizontal size. #363 ?

    Recently merged PRs gained us a lot of horizontal space so I thought it might no longer be an obstacle.

    The issue with arrows is they would not resolve the discrepancy between the connection direction and type, which are displayed in full in the details area (“Outbound Full Relay”) but lack the direction in the main table (“Full Relay”). This causes confusion, e.g. for a bitcoin dev in a bitcoin/bitcoin issue who thought it was a bug.

  23. rebroad commented at 2:21 pm on June 26, 2021: contributor
    NACK - I prefer the existing functionality. It could be possible to have a 4-click sort method on the existing column though if you wanted to choose to sort by the direction.
  24. jonatack commented at 3:27 pm on June 26, 2021: contributor
    Given the opposition to having a direction column, I wonder if the connection type column should be removed. Direction and type of connection go together and displaying only half of the two has been seen by experienced users as a bug. I think that’s the wrong direction, but it is what reviewers seem to want. Edit: done in #372.
  25. ghost commented at 5:54 am on June 27, 2021: none

    Users can now sort the peers table by direction.

    With the up/down arrow before the address in the same column, you can already sort by direction. The column is sorted (or you could also say “grouped” like in https://github.com/bitcoin/bitcoin/pull/13537 where the arrow prefix was introduced) by direction first (since the arrow is the first character), then by address (the following characters). You only cannot sort by address regardless of the direction, but I wonder what the use case could be for that. I only thought that would be the case. See issue #397

  26. jonatack commented at 9:00 am on July 4, 2021: contributor
    Note that #372 (which reverts the addition of the “type” column) or this PR ought to be merged for v22.0 to avoid confusing users with a half-implemented feature that may look like a bug.
  27. jarolrod commented at 3:30 am on July 6, 2021: member

    @luke-jr

    This still takes up an annoying chunk of horizontal size. #363 ?

    #256 now allows a user to customize the widths of the table columns. It does not take up an annoying chunk of horizontal size if the user has resized the columns to their preference. @rebroad

    NACK - I prefer the existing functionality.

    The existing functionality of no Direction column? 🤔

  28. shaavan commented at 4:13 pm on July 27, 2021: contributor

    tACK 6971e790c32253ecddb6108e796afd3892ced7fe

    Compiled and tested successfully on Ubuntu 20.04

    Displaying Connection Direction would help clarify some confusion regarding connection direction, as was suggested in #289. I like the approach of this PR over #363, because for the following reasons:

    • The horizontal arrows do not have a strong connotation of IN and OUT as compared to vertical arrows.
    • Without mentioning the purpose of the left and right arrows in the column header, it creates more confusion to a new user than clearing it.
    • Finally, the aesthetics of the arrow in #363 does not match with the rest of the table.

    I would, however, like to make a suggestion. Instead of removing the arrow, they should be moved to the Direction Column. And also‘OUTBOUND’ and ‘INBOUND’ should be replaced by ‘OUT’ and ‘IN” as it is done here (under PR alternative diff header in the table) as it would convey the information correctly at the same time being aesthetically more pleasing.

  29. hebasto commented at 10:28 am on August 8, 2021: member

    @promag

    No strong opinion, just think that with arrows it was more compact and clean.

    Arrows “up” and “down” have no meaning about the connection direction.

  30. hebasto commented at 10:41 am on August 8, 2021: member

    @wodry

    You only cannot sort by address regardless of the direction, but I wonder what the use case could be for that.

    To check if one’s node has more than one peers from a particular subnet.

  31. hebasto commented at 10:44 am on August 8, 2021: member

    @rebroad

    NACK - I prefer the existing functionality. It could be possible to have a 4-click sort method on the existing column though if you wanted to choose to sort by the direction.

    What is a “4-click sort method”?

  32. hebasto approved
  33. hebasto commented at 6:54 pm on August 8, 2021: member

    ACK 6971e790c32253ecddb6108e796afd3892ced7fe, tested on Linux Mint 20.2 (Qt 5.12.8).

    This change is an improvement for the following reasons:

    • both “Direction” and “Type” columns are coherent with peer details
    • the “Address” column is free from independent data
    • it is possible to sort by address and by direction independently
    • “up” and “down” arrows with no implicit or ubiquitous semantics of “inbound” and “outbound” have been replaced with the texts that are clear and understandable for everyone, including new users

    I do not consider taking horizontal space by the new “Direction” column as a blocker for approving this PR.

    A screenshot from my system:

    Screenshot from 2021-08-08 21-41-12

    It looks really great!

  34. ghost commented at 5:44 am on August 9, 2021: none

    I like #401 very much, please see my suggestion B.3 there.

    An empty connection type I find confusing. If the user sees (like I did with 22.0rc2), that always only all inbound connections have an empty type, the user thinks, OK I guess it’s not detectable or something for inbound. But it leaves uncertainty, is confusing.

  35. RandyMcMillan commented at 7:59 am on August 9, 2021: contributor

    Here is an example of a simple arrow based direction column for comparison.

    Using that much visual real estate for direction seems impractical.

    https://github.com/bitcoincore-dev/gui/pull/1

    ()

  36. hebasto commented at 8:02 am on August 9, 2021: member

    @RandyMcMillan

    Here is an example of a simple arrow based direction column for comparison.

    What does “↑” mean in the column with unnamed header title?

  37. RandyMcMillan commented at 8:29 am on August 9, 2021: contributor

    one possible option is to put a unicode earth symbol in the column title.

    🜨

    This is both prudent on visual real-estate and universally recognized.

    arrow up (as in upload) means outbound data to most people these days.

    arrow down (as in download) means inbound data these days.

  38. hebasto commented at 10:35 am on August 9, 2021: member

    @RandyMcMillan

    arrow up (as in upload) means outbound data to most people these days.

    arrow down (as in download) means inbound data these days.

    Upload/download are about a direction of data transferring. Inbound/outbound are about a connection initiator.

    Let’s don’t add more mess :)

  39. RandyMcMillan commented at 6:33 pm on August 9, 2021: contributor
    I was using the analogy to express an idea and possible approach to visual communication with the node operator. I apologize if something is getting lost in translation. I agree with you - a mess it is.
  40. RandyMcMillan commented at 6:47 pm on August 9, 2021: contributor

    I suspect the long term solution is to leverage existing symbolic/unicode libraries to communicate with the node operator. This is provide a lot of information about the node “at a glance” and minimize the need to translate. Using a symbolic library has the added benefit of being prudent in its use of gui real-estate. This will also affect on-going Android mobile GUI design.

    Reference: https://google.github.io/material-design-icons/

    Explaining fundamental GUI designs and concepts is fun. :) (not really)

  41. ghost commented at 8:08 pm on August 9, 2021: none
    Please see my updated #401 (comment) in the brainstorming issue, with a small commit and a screenshot. Please comment what you think of it.
  42. RandyMcMillan commented at 9:30 pm on August 9, 2021: contributor

    As I mentioned in the comment below - drawing inspiration from the established iconography of git is going to go a long way. In fact reusing the established icons for some gui elements may avoid reinventing the wheel on this…

    #401 (comment)

    REF: https://github.com/primer/octicons/tree/main/icons

  43. hebasto renamed this:
    Peers Tab Direction Column
    Add Direction column to Peers Tab
    on Aug 11, 2021
  44. hebasto merged this on Aug 11, 2021
  45. hebasto closed this on Aug 11, 2021

  46. sidhujag referenced this in commit 0b833772b1 on Aug 15, 2021
  47. in src/qt/peertablemodel.cpp:120 in 6971e790c3
    117-            return QString::fromStdString((rec->nodeStats.fInbound ? "↓ " : "↑ ") + rec->nodeStats.addrName);
    118+            return QString::fromStdString(rec->nodeStats.addrName);
    119+        case Direction:
    120+            return QString(rec->nodeStats.fInbound ?
    121+                               //: An Inbound Connection from a Peer.
    122+                               tr("Inbound") :
    


    rebroad commented at 12:21 pm on September 1, 2021:
    why not continue using the up and down arrows?

    hebasto commented at 3:11 pm on September 3, 2021:

    @rebroad

    How could the “down arrow” could mean a “connection initiated by a peer” for a new user?

  48. hebasto referenced this in commit ee1db7b6dc on Sep 12, 2021
  49. bitcoin-core locked this on Sep 3, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/gui. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-28 01:20 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me