2.7.2 Device Metrics Crash Fix (#1400)

* Bump version

* iOS 26 styled keyboard toolbar
Update tips backgrounds

* Link the logo to the about page

* Remove double logo on node list, update scary location log message, update tls toggle visibility and keyboard scroll dismiss on mqtt config

* Remove redundant colorScheme check

* Change background for textfield from a capsule to a RoundedRectangle

* Fix device metrics crash

* Add back rule marks for network colors
This commit is contained in:
Garth Vander Houwen 2025-09-13 18:51:34 -07:00 committed by GitHub
parent d95db4eb1e
commit b0eeeaf874
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 46 additions and 56 deletions

View file

@ -42088,4 +42088,4 @@
}
},
"version" : "1.1"
}
}

View file

@ -38,64 +38,54 @@ struct DeviceMetricsLog: View {
GroupBox(label: Label("\(deviceMetrics.count) Readings Total", systemImage: "chart.xyaxis.line")) {
Chart {
ForEach(chartData, id: \.self) { point in
if let batteryLevel = point.batteryLevel {
Plot {
LineMark(
x: .value("x", point.time!),
y: .value("y", batteryLevel)
)
if let pointTime = point.time {
if let batteryLevel = point.batteryLevel {
Plot {
LineMark(
x: .value("x", pointTime),
y: .value("y", batteryLevel)
)
}
.accessibilityLabel("Line Series")
.accessibilityValue("X: \(pointTime), Y: \(batteryLevel)")
.foregroundStyle(batteryChartColor)
.interpolationMethod(.linear)
}
.accessibilityLabel("Line Series")
.accessibilityValue("X: \(point.time!), Y: \(batteryLevel)")
.foregroundStyle(batteryChartColor)
.interpolationMethod(.linear)
}
if let channelUtilization = point.channelUtilization {
Plot {
PointMark(
x: .value("x", point.time!),
y: .value("y", channelUtilization)
)
.symbolSize(25)
if let channelUtilization = point.channelUtilization {
Plot {
PointMark(
x: .value("x", pointTime),
y: .value("y", channelUtilization)
)
.symbolSize(25)
}
.accessibilityLabel("Line Series")
.accessibilityValue("X: \(pointTime), Y: \(channelUtilization)")
.foregroundStyle(channelUtilizationChartColor)
}
.accessibilityLabel("Line Series")
.accessibilityValue("X: \(point.time!), Y: \(channelUtilization)")
.foregroundStyle(channelUtilizationChartColor)
}
if let chartSelection {
RuleMark(x: .value("Second", chartSelection, unit: .second))
.foregroundStyle(.tertiary.opacity(0.5))
// .annotation(
// position: .automatic,
// overflowResolution: .init(x: .fit, y: .disabled)
// ) {
// ZStack {
// Text("\(getTelemetry(for: chartSelection))")
// }
// .padding()
// .background {
// RoundedRectangle(cornerRadius: 4)
// .foregroundStyle(Color.accentColor.opacity(0.2))
// }
// }
}
RuleMark(y: .value("Network Status Orange", 25))
.lineStyle(StrokeStyle(lineWidth: 1, dash: [5, 10]))
.foregroundStyle(.orange)
RuleMark(y: .value("Network Status Red", 50))
.lineStyle(StrokeStyle(lineWidth: 1, dash: [5, 10]))
.foregroundStyle(.red)
if let airUtilTx = point.airUtilTx {
Plot {
PointMark(
x: .value("x", point.time!),
y: .value("y", airUtilTx)
)
.symbolSize(25)
if let chartSelection {
RuleMark(x: .value("Second", chartSelection, unit: .second))
.foregroundStyle(.tertiary.opacity(0.5))
}
RuleMark(y: .value("Network Status Orange", 25))
.lineStyle(StrokeStyle(lineWidth: 1, dash: [5, 10]))
.foregroundStyle(.orange)
RuleMark(y: .value("Network Status Red", 50))
.lineStyle(StrokeStyle(lineWidth: 1, dash: [5, 10]))
.foregroundStyle(.red)
if let airUtilTx = point.airUtilTx {
Plot {
PointMark(
x: .value("x", pointTime),
y: .value("y", airUtilTx)
)
.symbolSize(25)
}
.accessibilityLabel("Line Series")
.accessibilityValue("X: \(pointTime), Y: \(airUtilTx)")
.foregroundStyle(airtimeChartColor)
}
.accessibilityLabel("Line Series")
.accessibilityValue("X: \(point.time!), Y: \(airUtilTx)")
.foregroundStyle(airtimeChartColor)
}
}
}