perf(ui): 移除监控动效并精简原生图表绘制
This commit is contained in:
@@ -8,7 +8,6 @@ struct MetricRow<Detail: View>: View {
|
||||
let history: [Double?]
|
||||
let accent: Color
|
||||
@ViewBuilder let detail: () -> Detail
|
||||
@Environment(\.accessibilityReduceMotion) private var reduceMotion
|
||||
@State private var visible = false
|
||||
@State private var rowHovered = false
|
||||
@State private var detailHovered = false
|
||||
@@ -33,7 +32,6 @@ struct MetricRow<Detail: View>: View {
|
||||
Text(verbatim: value)
|
||||
.font(.system(size: 13, weight: .semibold, design: .rounded))
|
||||
.monospacedDigit()
|
||||
.contentTransition(.numericText())
|
||||
.frame(width: 46, alignment: .trailing)
|
||||
}
|
||||
.contentShape(Rectangle())
|
||||
@@ -56,6 +54,6 @@ struct MetricRow<Detail: View>: View {
|
||||
}
|
||||
.onAppear { visible = true }
|
||||
.onDisappear { visible = false; rowHovered = false; detailHovered = false; expanded = false }
|
||||
.animation(!visible || reduceMotion ? nil : .spring(duration: 0.3, bounce: 0), value: value)
|
||||
.transaction { $0.animation = nil; $0.disablesAnimations = true }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user