feat(menubar): 拆分紧凑双页面板并按页采样

This commit is contained in:
2026-11-08 10:42:55 +08:00
parent ac8b4a7e6a
commit 41dcc497b5
36 changed files with 465 additions and 288 deletions
+6
View File
@@ -14,6 +14,12 @@ nonisolated struct ProcessMetrics: Identifiable, Sendable {
let footprintBytes: UInt64? // Physical footprint; never RSS.
let threads: Int?
let restricted: Bool
var cpuPower: Double? = nil // Average attributed CPU power, watts; not Energy Impact.
var powerWindow: TimeInterval? = nil
var formattedPower: String {
guard let cpuPower, cpuPower.isFinite, cpuPower >= 0 else { return "--" }
return cpuPower >= 1 ? String(format: "%.2f W", cpuPower) : String(format: "%.1f mW", cpuPower * 1000)
}
}
nonisolated struct ProcessSnapshot: Sendable {