perf(ui): 移除监控动效并精简原生图表绘制
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import Foundation
|
||||
|
||||
@main struct AppearancePreferencesChecks {
|
||||
@MainActor static func main() {
|
||||
let suite = "kymo.appearance." + UUID().uuidString
|
||||
let defaults = UserDefaults(suiteName: suite)!
|
||||
defer { defaults.removePersistentDomain(forName: suite) }
|
||||
defaults.set(true, forKey: "appearance.reduceMotion")
|
||||
let sampling = SamplingPreferences(defaults: defaults)
|
||||
let appearance = AppearancePreferences(defaults: defaults)
|
||||
precondition(appearance.appearance == .system && !sampling.backgroundEnabled)
|
||||
appearance.appearance = .dark
|
||||
precondition(AppearancePreferences(defaults: defaults).appearance == .dark)
|
||||
precondition(!sampling.backgroundEnabled && sampling.panelMilliseconds == 2000)
|
||||
sampling.backgroundEnabled = true
|
||||
sampling.backgroundMilliseconds = 5000
|
||||
appearance.appearance = .light
|
||||
precondition(sampling.backgroundEnabled && sampling.backgroundMilliseconds == 5000)
|
||||
precondition(defaults.bool(forKey: "appearance.reduceMotion"), "Obsolete motion keys must be ignored, not overwritten")
|
||||
defaults.set("invalid", forKey: "appearance")
|
||||
precondition(AppearancePreferences(defaults: defaults).appearance == .system)
|
||||
print("PASS: appearance persistence/fallback, independent sampling and preservation of obsolete motion preferences")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user