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
@@ -4,7 +4,6 @@ import SwiftUI
struct MetricProgressBar: View {
let value: Double
let color: Color
@Environment(\.metricAnimationsEnabled) private var animates
private var fraction: Double { value.isFinite ? min(1, max(0, value)) : 0 }
@@ -16,8 +15,7 @@ struct MetricProgressBar: View {
}
.frame(width: proxy.size.width, height: proxy.size.height)
.clipShape(Capsule())
.animation(animates ? .easeInOut(duration: MetricMotion.duration) : nil, value: fraction)
.transaction { if !animates { $0.disablesAnimations = true } }
.transaction { $0.animation = nil; $0.disablesAnimations = true }
}
}
}