perf(efficiency): 落实首批采样减负与发行包瘦身

This commit is contained in:
2026-11-03 23:19:52 +08:00
parent 935701fca6
commit def3b1e130
40 changed files with 483 additions and 291 deletions
+14 -10
View File
@@ -47,14 +47,14 @@ struct MenuPanelView: View {
var body: some View {
VStack(spacing: PanelStyle.gap) {
header
if PanelResourceAudit.omitted != "header" { header }
if PanelLayout.needsResourceScroll(size: panelSize, rows: rowHeights) {
ScrollView { resourceRows }
.frame(maxHeight: PanelLayout.resourceHeight(rows: rowHeights))
} else {
resourceRows
}
if metrics.isPanelVisible {
if metrics.isPanelVisible && PanelResourceAudit.omitted != "processes" {
ProcessTableView(snapshot: snapshot.processes, wide: panelSize.width >= 900).frame(maxWidth: .infinity, maxHeight: .infinity)
.frame(minHeight: 170)
}
@@ -98,14 +98,18 @@ struct MenuPanelView: View {
}
@ViewBuilder private func resourceCard(at index: Int) -> some View {
switch index {
case 0: cpuCard
case 1: gpuCard
case 2: batteryCard
case 3: memoryCard
case 4: diskCard
case 5: networkCard
default: EmptyView()
if PanelResourceAudit.omitted == "resources" {
Color.clear
} else {
switch index {
case 0: cpuCard
case 1: gpuCard
case 2: batteryCard
case 3: memoryCard
case 4: diskCard
case 5: networkCard
default: EmptyView()
}
}
}