-
-
Notifications
You must be signed in to change notification settings - Fork 83
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 node name below traceroute node circles #966
base: main
Are you sure you want to change the base?
Conversation
Could you attach a screenshot for reference showing how this renders in the UI? |
@@ -869,6 +869,7 @@ class BLEManager: NSObject, CBPeripheralDelegate, MqttClientProxyManagerDelegate | |||
traceRoute?.hasPositions = true | |||
} | |||
} | |||
traceRouteHop.name = hopNode?.user?.longName ?? "Unknown" |
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.
Is this overriding an existing traceRouteHop.name
value or is this populating an empty field?
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 field is currently not used.
I was a bit torn with this one. Without a data model update, we have one name. That could be used for the short name, to correct the name inside the circle. Otherwise, there is this option, to add the long name under the circle.
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.
traceRouteHop.name = hopNode?.user?.longName ?? "Unknown" | |
traceRouteHop.name = hopNode?.user?.longName ?? Constants.unknownTracerouteHopName |
and
private extension BLEManager {
enum Constants {
static let unknownTracerouteHopName = String(localized: "Unknown", comment: "Label: Unknown trace route node name")
}
}
@@ -869,6 +869,7 @@ class BLEManager: NSObject, CBPeripheralDelegate, MqttClientProxyManagerDelegate | |||
traceRoute?.hasPositions = true | |||
} | |||
} | |||
traceRouteHop.name = hopNode?.user?.longName ?? "Unknown" |
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.
traceRouteHop.name = hopNode?.user?.longName ?? "Unknown" | |
traceRouteHop.name = hopNode?.user?.longName ?? Constants.unknownTracerouteHopName |
and
private extension BLEManager {
enum Constants {
static let unknownTracerouteHopName = String(localized: "Unknown", comment: "Label: Unknown trace route node name")
}
}
@@ -898,6 +899,7 @@ class BLEManager: NSObject, CBPeripheralDelegate, MqttClientProxyManagerDelegate | |||
traceRoute?.hasPositions = true | |||
} | |||
} | |||
traceRouteHop.name = hopNode?.user?.longName ?? "Unknown" |
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.
traceRouteHop.name = hopNode?.user?.longName ?? "Unknown" | |
traceRouteHop.name = hopNode?.user?.longName ?? Constants.unknownTracerouteHopName |
Text(String(hops[i].name ?? "Unknown")) | ||
.font(idiom == .phone ? .caption2 : .headline) | ||
.allowsTightening(true) | ||
.fontWeight(.semibold) | ||
Text("\(String(format: "%.2f", hops[i].snr)) dB") |
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.
Text("\(String(format: "%.2f", hops[i].snr)) dB") | |
Text("\(hops[i].snr.formatted(.number.rounded(rule: .toNearestOrAwayFromZero))) dB") |
@@ -225,6 +225,10 @@ struct TraceRouteLog: View { | |||
VStack { | |||
let nodeColor = UIColor(hex: UInt32(truncatingIfNeeded: hops[i].num)) | |||
CircleText(text: String(hops[i].num.toHex().suffix(4)), color: Color(nodeColor), circleSize: idiom == .phone ? 70 : 125) | |||
Text(String(hops[i].name ?? "Unknown")) |
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.
Unknown
is not localized:
Text(String(hops[i].name ?? "Unknown")) | |
Text(String(hops[i].name ?? "Unknown")) |
What changed?
Proposing adding the long node name below the node circles in the tracroute view. This change adds
some missing traceRouteHop name assignments and then adds the name string below the node
circle and above the snr string.
Why did it change?
Currently neither the node's short nor long name are part of circular traceroute view. This leverages the
fact that the name is already available to the view and adds it in the same way other node circle names
are represented elsewhere in the app.
How is this tested?
Ran various traceroute iterations and saw that the name was being shown under the circles in the circular
traceroute display.
Screenshots/Videos (when applicable)
Checklist