Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Type column to peers window, update peer details name/tooltip #179

Merged
merged 3 commits into from Feb 22, 2021

Conversation

jonatack
Copy link
Contributor

@jonatack jonatack commented Jan 9, 2021

This pull:

  • adds a sortable Type column to the GUI Peers tab window
  • updates the peer details row to Direction/Type, so the Type column without a direction makes sense (the tooltip is also updated)

Screenshot from 2021-02-06 22-53-11

@jonatack jonatack changed the title gui: add direction and type columns to peers window Add direction and type columns to peers window Jan 9, 2021
Copy link
Member

@jarolrod jarolrod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 09aa053

I love this! I was just thinking about how this would be a good feature today, you beat me to it. Code looks good to me. Tested on macOS Big Sur 11.1 with Qt 5.15.2

Screen Shot 2021-01-09 at 8 47 42 PM

@jonatack
Copy link
Contributor Author

Thanks! Though I should drop the relay type from inbound or check if full or block (same in -netinfo).

@hebasto
Copy link
Member

hebasto commented Jan 10, 2021

Concept ACK.

@jonatack
Copy link
Contributor Author

jonatack commented Jan 10, 2021

Rebased after merge of #163, added relay type for inbounds, and inversed the sort for the Direction column to be inbound first.

case PeerTableModel::Direction:
return pLeft->fInbound > pRight->fInbound;
case PeerTableModel::ConnectionType:
return pLeft->m_conn_type < pRight->m_conn_type;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Memo to myself, if we prefer to sort alphabetically by type name rather than by enum order:

-        return pLeft->m_conn_type < pRight->m_conn_type;
+        return GUIUtil::ConnectionTypeToShortQString(pLeft->m_conn_type, pLeft->fRelayTxes) < GUIUtil::ConnectionTypeToShortQString(pRight->m_conn_type, pRight->fRelayTxes);

src/qt/peertablemodel.h Outdated Show resolved Hide resolved
src/qt/guiutil.cpp Outdated Show resolved Hide resolved
@jonatack jonatack force-pushed the add-peers-dir-and-type-columns branch from a657b0c to 9f76ba6 Compare January 10, 2021 18:22
@jonatack
Copy link
Contributor Author

Thank you @hebasto for your feedback! Updated with your suggestions per git diff a657b0c 9f76ba6

Copy link
Member

@hebasto hebasto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 9f76ba6, tested on Linux Mint 20.1 (Qt 5.12.8):

Screenshot from 2021-01-10 22-01-41

@jarolrod
Copy link
Member

re-ACK 9f76ba6, tested on macOS Big Sur 11.1 (Qt 5.15.2)

@luke-jr
Copy link
Member

luke-jr commented Jan 13, 2021

Why are Outbound/Inbound strings better than arrows?

@jonatack
Copy link
Contributor Author

Why are Outbound/Inbound strings better than arrows?

Good question. I proposed words instead of arrows for these reasons:

  1. The peer details area uses words. When it displays, say, "Outbound Full Relay", it seems more coherent for the column data to also display "Outbound" and "Full Relay", than up-arrow and "Full Relay"
  2. -getinfo and -netinfo both also use words for the direction rather than arrows

@luke-jr
Copy link
Member

luke-jr commented Jan 13, 2021

Words use a lot more space than arrows... It's not unreasonable to have details show more .. detail :p

@hebasto
Copy link
Member

hebasto commented Jan 13, 2021

Why are Outbound/Inbound strings better than arrows?

Words use a lot more space than arrows... It's not unreasonable to have details show more .. detail :p

Actually, words simplify the GUI for new-comers, as an "arrow up" does not imply "outbound" at all.

@jonatack
Copy link
Contributor Author

Agree. And the GUI uses words for the direction in the main info tab.

@jonatack
Copy link
Contributor Author

(If space is an issue we could use in/out instead of inbound/outbound, as that is the wording in the GUI info tab, -getinfo, and -netinfo)

@hebasto
Copy link
Member

hebasto commented Jan 14, 2021

(If space is an issue we could use in/out instead of inbound/outbound, as that is the wording in the GUI info tab, -getinfo, and -netinfo)

I was thinking about it from the beginning, but it won't work for some translations.

@jarolrod
Copy link
Member

(If space is an issue we could use in/out instead of inbound/outbound, as that is the wording in the GUI info tab, -getinfo, and -netinfo)

I think we should stick with inbound/outbound. Even if you changed to in/out wouldn't Direction keep the tab at about the same size

@luke-jr
Copy link
Member

luke-jr commented Jan 17, 2021

I was thinking something more like this:

jonatack/gui@add-peers-dir-and-type-columns...luke-jr:tmp_gui_peers_dir_arrows

@jarolrod
Copy link
Member

I was thinking something more like this:

jonatack/gui@add-peers-dir-and-type-columns...luke-jr:tmp_gui_peers_dir_arrows

Below is a screenshot of what your branch looks like for me, font issue with the arrows. Anyways, my vote is still for inbound/outbound
lukejr-arrows

@luke-jr
Copy link
Member

luke-jr commented Jan 17, 2021

I suppose we could also do icons with an arrow and tiny in/out text under it

@RandyMcMillan
Copy link
Contributor

@jonatack @hebasto

This worked for me...

https://github.com/bitcoin-core/gui/pull/135/files#diff-e721b02fefce2a90ae95da0841adfdcc610ffccf93236ef236f81c1baead8e01R163

Most of the issues you may run into - I already figured out...

#135

@jonatack
Copy link
Contributor Author

This current PR with 2 ACKs is my preferred version among the various proposals I have seen.

@jonatack
Copy link
Contributor Author

I propose that further refinements be done in a follow-up (not by me ;).

@RandyMcMillan
Copy link
Contributor

RandyMcMillan commented Jan 18, 2021

Something I didn't get to yet - was to separate the uacomment and give it its own column.
This could be very useful for some other ideas Ive been thinking about.

@luke-jr
Copy link
Member

luke-jr commented Jan 18, 2021

jonatack/gui@add-peers-dir-and-type-columns...luke-jr:tmp_gui_peers_dir_arrows is now translation-friendly...

I'm still weak concept nack on inbound/outbound as strings in the table. I think it's worse than the status quo, so would rather this not be merged as-is.

@jonatack jonatack marked this pull request as draft January 29, 2021 15:48
@jonatack
Copy link
Contributor Author

Moving this back to Draft status until #201 is resolved.

@jonatack jonatack force-pushed the add-peers-dir-and-type-columns branch from 9f76ba6 to be4cf48 Compare February 6, 2021 22:04
@jonatack jonatack marked this pull request as ready for review February 6, 2021 22:07
@jonatack
Copy link
Contributor Author

jonatack commented Feb 6, 2021

Ready for review again. Three changes from the previous version:

  • It no longer replaces the arrows with a Direction column, which had 2 ACKs but also a light NACK and which can be decided later in another pull
  • For now, inbound peers do not display anything in the Type column, following the logic of merged Display plain "Inbound" in peer details #203
  • In the details area, the Connection Type field is renamed to Direction/Type, so the Type column without a direction makes sense. Its tooltip is also updated.

I hope the translations work correctly in this latest push.

@hebasto, @jarolrod, @luke-jr, @RandyMcMillan, would you mind having another look?

@jonatack
Copy link
Contributor Author

jonatack commented Feb 6, 2021

Updated the PR description and screenshot with this one:

Screenshot from 2021-02-06 22-53-11

@jonatack jonatack changed the title Add direction and type columns to peers window Add Type column to peers window, update peer details name/tooltip Feb 6, 2021
@jarolrod
Copy link
Member

ACK be4cf48

Tested with Spanish translations. The text added in the tooltip and text associated with the Type column will need translations.

pr179-spanishtest

Copy link

@leonardojobim leonardojobim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested ACK be4cf48 on Ubuntu 20.04 on VMWare.

image

@RandyMcMillan
Copy link
Contributor

Removing "Peer" from the "Peer Id" column would allow for more prudent use of space.
Otherwise it should be translatable. A simple "ID" or "id" would be better. I think all caps "ID" is better imo.

Maybe Type and Network should be left justified?


NOTE: #202

PR #202 is going to allow for more info/columns to be added - and more info displayed "at a glance". As more columns are added - the columns can be adjusted for a tighter fit and/or column stretching in a resize event.


ACK 6fc72bd

macOS 10.14.6 (18G103)

Screen Shot 2021-02-21 at 7 22 01 PM

@maflcko maflcko merged commit 02fda82 into bitcoin-core:master Feb 22, 2021
@jonatack jonatack deleted the add-peers-dir-and-type-columns branch February 22, 2021 13:13
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Feb 22, 2021
… peer details name/tooltip

be4cf48 gui: update to "Direction/Type" peer details name/tooltip (Jon Atack)
1518883 gui: add "Type" column to Peers main window (Jon Atack)
6fc72bd gui: allow ConnectionTypeToQString to prepend direction optionally (Jon Atack)

Pull request description:

  This pull:

  - adds a sortable `Type` column to the GUI Peers tab window
  - updates the peer details row to `Direction/Type`, so the `Type` column without a direction makes sense (the tooltip is also updated)

  ![Screenshot from 2021-02-06 22-53-11](https://user-images.githubusercontent.com/2415484/107130646-973bee80-68c7-11eb-9025-b18394ac5c93.png)

ACKs for top commit:
  jarolrod:
    ACK be4cf48
  leonardojobim:
    Tested ACK bitcoin-core/gui@be4cf48  on Ubuntu 20.04 on VMWare.

Tree-SHA512: 6c6d1dbe7d6bdb616acff0aaf8f4223546f1d2524566e9cd6e5b1b3bed2be1e9b20b1bc52ed3b627df53ba1f2fe0bc76f036cf16ad934d8a446b515d9bece3b1
gwillen pushed a commit to ElementsProject/elements that referenced this pull request Jun 28, 2022
@bitcoin-core bitcoin-core locked as resolved and limited conversation to collaborators Aug 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants