-
Notifications
You must be signed in to change notification settings - Fork 41
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
qml: Add PeerDetails page #387
Conversation
@@ -292,6 +294,8 @@ int QmlGuiMain(int argc, char* argv[]) | |||
qmlRegisterSingletonInstance<AppMode>("org.bitcoincore.qt", 1, 0, "AppMode", &app_mode); | |||
qmlRegisterType<BlockClockDial>("org.bitcoincore.qt", 1, 0, "BlockClockDial"); | |||
qmlRegisterType<LineGraph>("org.bitcoincore.qt", 1, 0, "LineGraph"); | |||
qmlRegisterUncreatableType<PeerDetailsModel>("org.bitcoincore.qt", 1, 0, "PeerDetailsModel", ""); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clip: true | ||
contentWidth: width | ||
|
||
Column { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think a max width with an elipses should cover it. I'll see what that looks like.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
values now elide
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
user might want to view all Services
maybe be good to put the missing ones in a tooltip?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also things like onion address should be fully visible imo
#375 (review)
480c03f
to
b5e2de7
Compare
b5e2de7 weird jumping when clicking on peer, at Direction, User agent_, Type, Ip and Network jumping.webm |
This appears to be due to using the wrong index for the original model. I have updated the branch with a working solution |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what was the motivation behind current shown details?
some things like Connection Time (Age), Network, Last Block, Last Transaction are missing
src/qml/pages/node/PeerDetails.qml
Outdated
CoreText { text: "Information"; bold: true; font.pixelSize: 18; horizontalAlignment: Qt.AlignLeft; } | ||
Column { | ||
width: parent.width | ||
PeerKeyValueRow { key: qsTr("IP"); value: details.address } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PeerKeyValueRow { key: qsTr("IP"); value: details.address } | |
PeerKeyValueRow { key: qsTr("Address"); value: details.address } |
can also be onion service/ other networks
src/qml/pages/node/PeerDetails.qml
Outdated
PeerKeyValueRow { key: qsTr("Version"); value: details.version } | ||
PeerKeyValueRow { key: qsTr("User agent"); value: details.userAgent } | ||
PeerKeyValueRow { key: qsTr("Services"); value: details.services } | ||
PeerKeyValueRow { key: qsTr("Transport relay"); value: details.transactionRelay } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PeerKeyValueRow { key: qsTr("Transport relay"); value: details.transactionRelay } | |
PeerKeyValueRow { key: qsTr("Transaction relay"); value: details.transactionRelay } |
CoreText { text: "Block data"; bold: true; font.pixelSize: 18; horizontalAlignment: Qt.AlignLeft; } | ||
Column { | ||
width: parent.width | ||
PeerKeyValueRow { key: qsTr("Starting block"); value: details.startingHeight } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Starting Block
doesn't seem to work correctly, for me this always shows 0
(testing with a synced signet node, normal bitcoin qt it works fine)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed that the Qt gui uses a value from a different struct. I will switch to that and see if that resolves it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes it works now
Great work. I tested it out on Android. Looks great overall, just see some inconsistencies to the design in terms of vertical spacing and missing formatting. For text that does not fit in one line, I think it should just go multi-line. If you shorten it, you then need a way to expand it (which could be a simple tap). In the image below, the Android screenshot is on the right, and the Figma mock-ups are on the left. A few questions:
|
yes, it means that that peer didn't announce that info yet
any special permissions that have been granted to that peer. N/A means Not Applicable / Not Assessed
Mapped Autonomous System, which can be used for diversifying peer selection
As peers are connecting and disconnecting all the time this is quite hard: Do you measure it for all currently connected peers, since the node is up, since first launch... etc. So, I get what you mean, but this shouldn't be added imo |
Ill adjust that spacing. Looks like mine is too tight.
I'll use word wrap on the next update
It means that it hasn't synced any headers with this peer yet. -1 is the default vault. I think this should just probably just be a minus as well until this data updates.
These are all of the permission strings "bloomfilter", "noban", "forcerelay" "relay" "mempool" "download" "addr". N/A just means that none are set. These permissions are assigned by using the "-whitelist" configuration option. Here are the description of these flags.
Mapped AS means Mapped Autonomous System which is a configuration option that lets you map peers to AS numbers. AS numbers are assigned by top level internet registries to organizations with a bunch of network addresses. You specify a mapping file to bitcoin core with a configuration option.
Yeah I think there is a lot of value in that. |
running d737ea3, I now had twice that the peer details page closed itself randomly and returned to the peers page.
forgot to add the change?
this looks good 👍 |
Thanks for the explainers and tweaking the layout.
Does that mean permissions are application-wide and the same for all peers? If so, maybe they can be shown elsewhere...?
Are we using "N/A" and "-" interchangeably? Looks like we need states for
Does that seem about right? What's the likelihood of getting "not available"? Is that even possible? |
Yeah im worried about this. I will dig into that and make sure my signals are being triggered correctly |
I also had this happen. |
Good stuff guys. In line with external feedback we received in past Bitcoin Core calls, a little tooltip and explainers for these items would be extremely useful. Even the tip that @johnny9 provided about how peer permissions can be changed would be useful (on this page or somewhere else)
|
For this PR generally, I'm happy to ACK it whenever the functionality is solid and we can tweak visualization details and tips as we live with it during practical usage. |
src/qml/pages/node/PeerDetails.qml
Outdated
anchors.horizontalCenter: parent.horizontalCenter | ||
spacing: 10 | ||
|
||
CoreText { text: "Information"; bold: true; font.pixelSize: 18; horizontalAlignment: Qt.AlignLeft; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Every categories CoreText declaration also needs to specify color as Theme.color.neutral9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Transport version and Connection Time with the peer should be added imo
I think we need to re-sync with main before we add transport type but I can add Connection Time to the Network traffic section |
b4f8fc1
to
c8344d8
Compare
and the Network (ipv4, onion etc), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
apart from some minor things, like the dialog sometimes randomly closing.
I think this is good enough and improvements can be made later on
ACK c8344d8
nice work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost there for the basic functionality of this page, some spacing is not adherent to the design file
src/qml/pages/node/PeerDetails.qml
Outdated
PeerKeyValueRow { key: qsTr("Address"); value: details.address } | ||
PeerKeyValueRow { key: qsTr("VIA"); value: details.addressLocal } | ||
PeerKeyValueRow { key: qsTr("Type"); value: details.type } | ||
PeerKeyValueRow { key: qsTr("Permission"); value: details.permission } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PeerKeyValueRow { key: qsTr("Permission"); value: details.permission } | |
PeerKeyValueRow { key: qsTr("Permissions"); value: details.permission } |
src/qml/pages/node/PeerDetails.qml
Outdated
} | ||
Column { | ||
width: parent.width | ||
spacing: 5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The spacing between sections of information is actually 15, so we'd want to add a bottom margin of 5
diff --git a/src/qml/pages/node/PeerDetails.qml b/src/qml/pages/node/PeerDetails.qml
index 224aef8c7..b32c2a0c7 100644
--- a/src/qml/pages/node/PeerDetails.qml
+++ b/src/qml/pages/node/PeerDetails.qml
@@ -79,6 +79,7 @@ Page {
Column {
width: parent.width
spacing: 5
+ bottomPadding: 5
PeerKeyValueRow { key: qsTr("Address"); value: details.address }
PeerKeyValueRow { key: qsTr("VIA"); value: details.addressLocal }
PeerKeyValueRow { key: qsTr("Type"); value: details.type }
@@ -101,6 +102,7 @@ Page {
Column {
width: parent.width
spacing: 5
+ bottomPadding: 5
PeerKeyValueRow { key: qsTr("Starting block"); value: details.startingHeight }
PeerKeyValueRow { key: qsTr("Synced headers"); value: details.syncedHeaders }
PeerKeyValueRow { key: qsTr("Synced blocks"); value: details.syncedBlocks }
@@ -116,6 +118,7 @@ Page {
Column {
width: parent.width
spacing: 5
+ bottomPadding: 5
PeerKeyValueRow { key: qsTr("Direction"); value: details.direction }
PeerKeyValueRow { key: qsTr("Connection time"); value: details.connectionDuration }
PeerKeyValueRow { key: qsTr("Last send"); value: details.lastSend }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Column { | ||
width: Math.min(parent.width - 40, 450) | ||
anchors.horizontalCenter: parent.horizontalCenter | ||
spacing: 10 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we want to add top and bottom padding of 30 to adhere to the design file
spacing: 10 | |
spacing: 10 | |
topPadding: 30 | |
bottomPadding: 30 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
component PeerKeyValueRow: Row { | ||
width: parent.width | ||
property string key: "" | ||
property string value: "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also
property string value: "" | |
property string value: "" | |
spacing: 10 |
c8344d8
to
eb5030f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eb5030f the new spacing can cause some overlap
eb5030f
to
fa4e080
Compare
Thank you, updated with the height attached to the lineCount of the value
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ack fa4e080
Just ran the latest artefact, and it looks pretty good. Didn't see any spacing issues. ACK. |
Do I see it correctly that the line height is hard-coded? Users can typically adjust text size via accessibility settings, which means the line height will also differ. Is there a way to automatically calculate this value? In Figma and CSS, I usually define the line height as a percentage (see how that is defined in CSS here). Is that possible? Might be easier to work with. |
#388 is proposed as an alternative which handles some of the outstanding issues, implements more functionality |
Closing this as it is superseded with #388 |
02d3121 qml: Add PeerDetails page (johnny9) 1ed2188 qml: Introduce KeyValueRow control (jarolrod) 052b5be qml: Introduce minus icon (jarolrod) Pull request description: Alternative to #387 which expands to think about a reusable row component, allowing to load any element(s) to the value field, not hardcoding in a height of 21 for a row (but still ensuring it's a minimum of 21), proper icon usage for N/A cases, dummy net indicators in place TODO: - Ban buttons - Hover hints - Disconnected state instead of flying back to the peers table - Smart text fixups <img width="752" alt="Screenshot 2024-02-28 at 3 53 43 AM" src="https://github.com/bitcoin-core/gui-qml/assets/23396902/7b3b8f7f-f490-4233-a540-736e34760116"> Link to github actions build artifacts. [![Build Artifacts](https://img.shields.io/badge/Build%20Artifacts-green )]() ACKs for top commit: MarnixCroes: tACK 02d3121 D33r-Gee: tACK 02d3121 pablomartin4btc: utACK 02d3121 Tree-SHA512: 26e3782e4cac2629bbeef40815edeaaddf59f91ec8f63017e5b8c223c4060c0a535b2640a7dbf34e4b25a20fa887a6bc109f7d57c5864a6d9896832db7f87b9f
This commit introduces a new page, PeerDetails, that shows additional information on a Peer after it is selected from the list of Peers. After clicking on the peer, the new page gets pushed onto the settings stack. Two conditions will cause the view to pop, the user clicking the Back at the top left or the peer disconnecting.
For reviewers, I would very much like comments on the conversion of the Stats struct to the QML compatible object that is used.
This commit does not include the disconnect/ban buttons, the top right buttons to cycle through the peers, or the icons that are adjacent to the values.
Link to github actions build artifacts.