diff --git a/docs/unified-panel-validation.md b/docs/unified-panel-validation.md index af441a2..3d62a05 100644 --- a/docs/unified-panel-validation.md +++ b/docs/unified-panel-validation.md @@ -219,3 +219,7 @@ GPU 专项第二轮:已完成 LLDB 失败分支定位、探针调用原样转 - 压力只显示系统等级;缓存单独显示,不叠加到容量分类。 - 实际面板视觉验收待重新运行;构建与采样检查见本轮交付。 - 本轮签名 Debug 构建通过;MemoryChecks 通过 48 GiB 换算、零值/缺失值和分类总和验证。本机采样总量 48.0 GiB,已用约 38.1 GiB、缓存约 7.8 GiB、压力等级 1(正常)。保留用户原有进程,未重新启动面板,完整 UI 展示尚未实测。 + +### 内存卡片配色与底栏细化 +- 使用独立内存色板:应用亮蓝、联动淡紫、压缩琥珀、可用灰,分布条和图例共用顺序,避免复用其他指标颜色导致漂移。 +- 底栏三项均为左对齐双行,等宽列之间加入两条竖线;用量标题改为总利用率。 diff --git a/kymo/Assets.xcassets/MemoryApplication.colorset/Contents.json b/kymo/Assets.xcassets/MemoryApplication.colorset/Contents.json new file mode 100644 index 0000000..c37f908 --- /dev/null +++ b/kymo/Assets.xcassets/MemoryApplication.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors": [ + { + "idiom": "universal", + "color": { + "color-space": "srgb", + "components": { + "red": "0.141176", + "green": "0.458824", + "blue": "0.823529", + "alpha": "1.000" + } + } + }, + { + "idiom": "universal", + "color": { + "color-space": "srgb", + "components": { + "red": "0.196078", + "green": "0.596078", + "blue": "1.000000", + "alpha": "1.000" + } + }, + "appearances": [ + { + "appearance": "luminosity", + "value": "dark" + } + ] + } + ], + "info": { + "author": "xcode", + "version": 1 + } +} diff --git a/kymo/Assets.xcassets/MemoryAvailable.colorset/Contents.json b/kymo/Assets.xcassets/MemoryAvailable.colorset/Contents.json new file mode 100644 index 0000000..42685c1 --- /dev/null +++ b/kymo/Assets.xcassets/MemoryAvailable.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors": [ + { + "idiom": "universal", + "color": { + "color-space": "srgb", + "components": { + "red": "0.678431", + "green": "0.701961", + "blue": "0.749020", + "alpha": "1.000" + } + } + }, + { + "idiom": "universal", + "color": { + "color-space": "srgb", + "components": { + "red": "0.384314", + "green": "0.423529", + "blue": "0.486275", + "alpha": "1.000" + } + }, + "appearances": [ + { + "appearance": "luminosity", + "value": "dark" + } + ] + } + ], + "info": { + "author": "xcode", + "version": 1 + } +} diff --git a/kymo/Assets.xcassets/MemoryCompressed.colorset/Contents.json b/kymo/Assets.xcassets/MemoryCompressed.colorset/Contents.json new file mode 100644 index 0000000..1bb39e8 --- /dev/null +++ b/kymo/Assets.xcassets/MemoryCompressed.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors": [ + { + "idiom": "universal", + "color": { + "color-space": "srgb", + "components": { + "red": "0.678431", + "green": "0.447059", + "blue": "0.050980", + "alpha": "1.000" + } + } + }, + { + "idiom": "universal", + "color": { + "color-space": "srgb", + "components": { + "red": "0.964706", + "green": "0.737255", + "blue": "0.282353", + "alpha": "1.000" + } + }, + "appearances": [ + { + "appearance": "luminosity", + "value": "dark" + } + ] + } + ], + "info": { + "author": "xcode", + "version": 1 + } +} diff --git a/kymo/Assets.xcassets/MemoryWired.colorset/Contents.json b/kymo/Assets.xcassets/MemoryWired.colorset/Contents.json new file mode 100644 index 0000000..9295219 --- /dev/null +++ b/kymo/Assets.xcassets/MemoryWired.colorset/Contents.json @@ -0,0 +1,38 @@ +{ + "colors": [ + { + "idiom": "universal", + "color": { + "color-space": "srgb", + "components": { + "red": "0.474510", + "green": "0.329412", + "blue": "0.780392", + "alpha": "1.000" + } + } + }, + { + "idiom": "universal", + "color": { + "color-space": "srgb", + "components": { + "red": "0.643137", + "green": "0.541176", + "blue": "0.949020", + "alpha": "1.000" + } + }, + "appearances": [ + { + "appearance": "luminosity", + "value": "dark" + } + ] + } + ], + "info": { + "author": "xcode", + "version": 1 + } +} diff --git a/kymo/Features/MenuBar/MemoryDetailsView.swift b/kymo/Features/MenuBar/MemoryDetailsView.swift index e32b351..c5c5dc6 100644 --- a/kymo/Features/MenuBar/MemoryDetailsView.swift +++ b/kymo/Features/MenuBar/MemoryDetailsView.swift @@ -3,7 +3,7 @@ import SwiftUI struct MemoryDetailsView: View { let memory: MemoryMetrics @Environment(\.accessibilityReduceMotion) private var reduceMotion - private var colors: [Color] { [Color("MetricMemory"), Color("MetricNetwork"), Color("MetricDisk"), .secondary.opacity(0.25)] } + private var colors: [Color] { [Color("MemoryApplication"), Color("MemoryWired"), Color("MemoryCompressed"), Color("MemoryAvailable")] } private var values: [UInt64] { [memory.app, memory.wired, memory.compressed, memory.available] } private let labels: [LocalizedStringKey] = ["memory.app", "memory.wired", "memory.compressed", "memory.available"] @@ -13,8 +13,8 @@ struct MemoryDetailsView: View { HStack { Text("memory.distribution").fontWeight(.semibold) Spacer() - Text("panel.total").foregroundStyle(.secondary) - AnimatedMetricText(value: MetricFormat.percent(memory.usage)).foregroundStyle(Color("MetricMemory")) + Text("gpu.totalUtilization").foregroundStyle(.secondary) + AnimatedMetricText(value: MetricFormat.percent(memory.usage)).foregroundStyle(Color("MemoryApplication")) } GeometryReader { proxy in HStack(spacing: 0) { @@ -45,11 +45,13 @@ struct MemoryDetailsView: View { Text("memory.pressure").foregroundStyle(.secondary) pressure }.frame(maxWidth: .infinity, alignment: .leading) + Divider().frame(height: 30) VStack(alignment: .leading, spacing: 4) { Text("memory.cached").foregroundStyle(.secondary) AnimatedMetricText(value: MetricFormat.memory(memory.cached)) }.frame(maxWidth: .infinity, alignment: .leading) .help(Text("memory.cachedHelp")) + Divider().frame(height: 30) VStack(alignment: .leading, spacing: 4) { Text("memory.swap").foregroundStyle(.secondary) AnimatedMetricText(value: MetricFormat.memory(memory.swapUsed)) diff --git a/kymo/Features/MenuBar/MenuPanelView.swift b/kymo/Features/MenuBar/MenuPanelView.swift index 6db455c..219147d 100644 --- a/kymo/Features/MenuBar/MenuPanelView.swift +++ b/kymo/Features/MenuBar/MenuPanelView.swift @@ -231,12 +231,12 @@ struct MenuPanelView: View { }.font(.system(size: 10)).help(Text("gpu.pipelineHelp")) } private var memoryCard: some View { - ResourceCard(title: "metric.memory", symbol: "memorychip", color: Color("MetricMemory"), + ResourceCard(title: "metric.memory", symbol: "memorychip", color: Color("MemoryApplication"), value: snapshot.memory.map { String(format: "%.1f / %.0f GiB", Double($0.used) / 1_073_741_824, Double($0.total) / 1_073_741_824) } ?? "--") { PanelTrendChart(dates: samples.map(\.date), first: samples.map { $0.memory.map { $0 * Double(snapshot.memory?.total ?? 1) } }, - color: Color("MetricMemory"), fixedScale: Double(snapshot.memory?.total ?? 1), - scaleLabel: MetricFormat.memory(snapshot.memory?.total), firstValueFormat: .memory, + color: Color("MemoryApplication"), fixedScale: Double(snapshot.memory?.total ?? 1), + scaleLabel: MetricFormat.memory(snapshot.memory?.total), firstValueFormat: .memory, firstLabel: "gpu.totalUtilization", expectedInterval: chartInterval, boundaryDates: chartBoundaries, intervals: chartIntervals) if let memory = snapshot.memory { MemoryDetailsView(memory: memory)