perf(ui): 移除监控动效并精简原生图表绘制

This commit is contained in:
2026-11-07 14:39:27 +08:00
parent 10c73c6026
commit 80706fa52e
54 changed files with 264 additions and 778 deletions
+1 -3
View File
@@ -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 }
}
}