feat(menubar): 完善首排监控卡片与温度风扇采样

补充 GPU 渲染分块、内存与利用率统计,增加只读 SMC 温度及风扇信息和旋转动效。完善电池功率与耗电进程列表,统一首排布局并固定异步加载区域高度。同步验证用例、架构说明和 GPU 能力调研工具。
This commit is contained in:
2026-11-03 16:42:09 +08:00
parent 45a6e16bb8
commit cc38066de2
43 changed files with 2658 additions and 536 deletions
+18 -2
View File
@@ -12,8 +12,24 @@ import SwiftUI
}
}
precondition(CPUCoreGridLayout.rowCounts(count: 18, width: 430) == [9, 9])
precondition(CPUCoreGridLayout.rowCounts(count: 18, width: 280) == [6, 6, 6])
precondition(CPUCoreGridLayout.rowCounts(count: 32, width: 430) == [11, 11, 10])
precondition(CPUCoreGridLayout.rowCounts(count: 18, width: 280) == [9, 9])
precondition(CPUCoreGridLayout.rowCounts(count: 32, width: 430) == [16, 16])
precondition(CPUCoreGridLayout.rowCounts(count: 48, width: 430) == [16, 16, 16])
for count in [0, 1, 4, 8, 14, 18, 24, 32, 48, 128] {
let kinds = Dictionary(uniqueKeysWithValues: (0..<count).map { ($0, $0 < count / 3 ? CPUCoreTopology.Kind.efficiency : .performance) })
let groups = CPUCoreGrid.groups(count: count, kinds: kinds)
precondition(groups.flatMap { $0 }.sorted() == Array(0..<count))
for width in [120.0, 280.0, 380.0, 800.0] {
let widths = CPUCoreGrid.groupWidths(groups: groups, width: width)
precondition(widths.allSatisfy { $0 >= 0 && $0.isFinite })
precondition(widths.reduce(0, +) <= width + 0.001)
for (group, groupWidth) in zip(groups, widths) {
let rows = CPUCoreGridLayout.rowCounts(count: group.count, width: groupWidth)
precondition(rows.count <= 3 && rows.reduce(0, +) == group.count)
}
}
}
precondition(CPUCoreGrid.groups(count: 3, kinds: [0: .efficiency]).count == 2)
print("PASS: balanced core rows at multiple widths and counts")
}
}