Skip to content

Commit 0bb6954

Browse files
authored
Merge pull request #1092 from DimensionDev/ios/20250709
Ios/20250709
2 parents 2b81bbe + 77fb21f commit 0bb6954

35 files changed

+544
-530
lines changed

iosApp/Generated/Sources/Assets.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public typealias AssetImageTypeAlias = ImageAsset.Image
2020

2121
// swiftlint:disable superfluous_disable_command file_length implicit_return
2222

23-
// MARK: - Asset Catalogs
23+
// - Asset Catalogs
2424

2525
// swiftlint:disable identifier_name line_length nesting type_body_length type_name
2626
public enum Asset {
@@ -148,7 +148,7 @@ public enum Asset {
148148

149149
// swiftlint:enable identifier_name line_length nesting type_body_length type_name
150150

151-
// MARK: - Implementation Details
151+
// - Implementation Details
152152

153153
public final class ColorAsset {
154154
public fileprivate(set) var name: String

iosApp/iosApp/Common/Performance/FloatingWindow/FloatingPerformanceWindow.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ struct FloatingPerformanceWindow: View {
2727
.animation(.easeInOut(duration: 0.2), value: windowManager.currentOpacity)
2828
}
2929

30-
// MARK: - Drag Gesture (Vertical Only)
30+
// - Drag Gesture (Vertical Only)
3131

3232
private var dragGesture: some Gesture {
3333
DragGesture()
@@ -136,7 +136,7 @@ struct ExpandedPerformanceView: View {
136136
.padding(.horizontal, 16)
137137
}
138138

139-
// MARK: - Computed Properties
139+
// - Computed Properties
140140

141141
private var cpuColor: Color {
142142
PerformanceConfig.Colors.cpuColor(for: monitor.currentCPUUsage)
@@ -350,7 +350,7 @@ struct MiniFrameRateDisplay: View {
350350
}
351351
}
352352

353-
// MARK: - Computed Properties - 从 FrameRateDisplayView 移植
353+
// - Computed Properties - 从 FrameRateDisplayView 移植
354354

355355
private func frameRateColor(for frameRate: Double) -> Color {
356356
if frameRate < stutterThreshold {
@@ -457,7 +457,7 @@ struct TimelinePerformanceTestSection: View {
457457
.animation(.easeInOut(duration: 0.3), value: showResults)
458458
}
459459

460-
// MARK: - Test Control Methods
460+
// - Test Control Methods
461461

462462
private func startPerformanceTest() {
463463
FlareLog.performance("PerformanceTest Starting performance test for \(versionManager.currentVersion.rawValue)")
@@ -494,7 +494,7 @@ struct TimelinePerformanceTestSection: View {
494494
}
495495
}
496496

497-
// MARK: - Data Collection
497+
// - Data Collection
498498

499499
private func startDataCollection() {
500500
FlareLog.performance("PerformanceTest Starting data collection timer")

iosApp/iosApp/Common/Performance/FloatingWindow/FloatingWindowManager.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,27 +18,27 @@ enum FloatingWindowState: String, CaseIterable {
1818
class FloatingWindowManager: ObservableObject {
1919
static let shared = FloatingWindowManager()
2020

21-
// MARK: - Published Properties
21+
// - Published Properties
2222

2323
@Published var state: FloatingWindowState = .hidden
2424
@Published var position: CGPoint = .init(x: 50, y: 100)
2525
@Published var isDragging: Bool = false
2626
@Published var opacity: Double = 0.9
2727
@Published var selectedChart: Int = 0 // 0: CPU, 1: Memory, 2: Frame Rate
2828

29-
// MARK: - Private Properties
29+
// - Private Properties
3030

3131
private var screenSize: CGSize = .zero
3232
private let edgeMargin: CGFloat = PerformanceConfig.FloatingWindow.Layout.edgeMargin
3333
private let snapDistance: CGFloat = PerformanceConfig.FloatingWindow.Layout.snapDistance
3434

35-
// MARK: - Initialization
35+
// - Initialization
3636

3737
private init() {
3838
loadPersistedState()
3939
}
4040

41-
// MARK: - Public Methods
41+
// - Public Methods
4242

4343
/// 显示浮动窗口(展开状态)
4444
func show() {
@@ -130,7 +130,7 @@ class FloatingWindowManager: ObservableObject {
130130
UserDefaults.standard.set(index, forKey: PerformanceConfig.FloatingWindow.UserDefaultsKeys.selectedChart)
131131
}
132132

133-
// MARK: - Private Methods
133+
// - Private Methods
134134

135135
/// 约束位置到屏幕范围内(仅Y轴,X轴固定为0)
136136
private func constrainToScreen(_ point: CGPoint) -> CGPoint {
@@ -214,7 +214,7 @@ class FloatingWindowManager: ObservableObject {
214214
}
215215
}
216216

217-
// MARK: - Computed Properties Extension
217+
// - Computed Properties Extension
218218

219219
extension FloatingWindowManager {
220220
/// 当前窗口尺寸

iosApp/iosApp/Common/Performance/FloatingWindow/FloatingWindowOverlay.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ struct FloatingWindowModifier: ViewModifier {
3838
}
3939
}
4040

41-
// MARK: - View Extension
41+
// - View Extension
4242

4343
extension View {
4444
/// 添加浮动性能监控窗口
@@ -165,7 +165,7 @@ struct FloatingWindowControlPanel: View {
165165
// )
166166
}
167167

168-
// MARK: - Computed Properties
168+
// - Computed Properties
169169

170170
private var stateColor: Color {
171171
switch windowManager.state {
@@ -194,7 +194,7 @@ struct FloatingWindowControlPanel: View {
194194
}
195195
}
196196

197-
// MARK: - Preview
197+
// - Preview
198198

199199
#Preview {
200200
VStack(spacing: 20) {

iosApp/iosApp/Common/Performance/FloatingWindow/SimpleLineChart.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ struct SimpleLineChart: View {
130130
}
131131
}
132132

133-
// MARK: - Preview
133+
// - Preview
134134

135135
#Preview {
136136
VStack(spacing: 20) {

iosApp/iosApp/Common/Performance/PerformanceConfig.swift

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import SwiftUI
44
/// 性能监控配置类
55
/// 统一管理所有性能监控相关的常量和配置
66
enum PerformanceConfig {
7-
// MARK: - Debug Configuration
7+
// - Debug Configuration
88

99
/// 是否启用调试模式(只在Debug构建中启用性能监控)
1010
static var isDebugModeEnabled: Bool {
@@ -20,7 +20,7 @@ enum PerformanceConfig {
2020
/// 是否启用详细日志输出
2121
static let isVerboseLoggingEnabled = true
2222

23-
// MARK: - Monitoring Configuration
23+
// - Monitoring Configuration
2424

2525
/// CPU和内存监控更新间隔(秒)
2626
/// Standardized to 0.5s for consistency with performance testing
@@ -41,7 +41,7 @@ enum PerformanceConfig {
4141
static let scrollFrameRates = 120 // 滚动性能分析(0.5s间隔)
4242
}
4343

44-
// MARK: - Performance Thresholds
44+
// - Performance Thresholds
4545

4646
/// 性能阈值配置
4747
enum Thresholds {
@@ -70,7 +70,7 @@ enum PerformanceConfig {
7070
}
7171
}
7272

73-
// MARK: - Floating Window Configuration
73+
// - Floating Window Configuration
7474

7575
/// 浮动窗口配置
7676
enum FloatingWindow {
@@ -101,7 +101,7 @@ enum PerformanceConfig {
101101
}
102102
}
103103

104-
// MARK: - Chart Configuration
104+
// - Chart Configuration
105105

106106
/// 图表配置
107107
enum Charts {
@@ -115,7 +115,7 @@ enum PerformanceConfig {
115115
static let miniChartHeight: CGFloat = 80
116116
}
117117

118-
// MARK: - Color Configuration
118+
// - Color Configuration
119119

120120
/// 性能状态颜色配置
121121
enum Colors {
@@ -178,7 +178,7 @@ enum PerformanceConfig {
178178
}
179179
}
180180

181-
// MARK: - Formatting Configuration
181+
// - Formatting Configuration
182182

183183
/// 数值格式化配置
184184
enum Formatting {
@@ -208,7 +208,7 @@ enum PerformanceConfig {
208208
}
209209
}
210210

211-
// MARK: - Performance Grades
211+
// - Performance Grades
212212

213213
/// 性能等级评估 - 动态适配120Hz设备
214214
enum PerformanceGrades {
@@ -269,7 +269,7 @@ enum PerformanceConfig {
269269
}
270270
}
271271

272-
// MARK: - Application Lifecycle
272+
// - Application Lifecycle
273273

274274
/// 应用生命周期配置
275275
enum Lifecycle {
@@ -284,38 +284,38 @@ enum PerformanceConfig {
284284
}
285285
}
286286

287-
// MARK: - Performance Theme
287+
// - Performance Theme
288288

289289
/// 性能监控主题配置
290290
enum PerformanceTheme {
291-
// MARK: - Card Styles
291+
// - Card Styles
292292

293293
static let cardCornerRadius: CGFloat = 16
294294
static let cardShadowRadius: CGFloat = 8
295295
static let cardShadowOffset = CGSize(width: 0, height: 4)
296296
static let cardShadowOpacity: Double = 0.2
297297

298-
// MARK: - Floating Window Styles
298+
// - Floating Window Styles
299299

300300
static let floatingWindowCornerRadius: CGFloat = 16
301301
static let floatingWindowShadowRadius: CGFloat = 12
302302
static let floatingWindowShadowOffset = CGSize(width: 0, height: 6)
303303
static let floatingWindowShadowOpacity: Double = 0.3
304304

305-
// MARK: - Animation Durations
305+
// - Animation Durations
306306

307307
static let stateTransitionDuration: Double = 0.3
308308
static let dragFeedbackDuration: Double = 0.2
309309
static let snapAnimationDuration: Double = 0.5
310310

311-
// MARK: - Fonts
311+
// - Fonts
312312

313313
static let titleFont = Font.headline
314314
static let subtitleFont = Font.subheadline
315315
static let captionFont = Font.caption
316316
static let monospaceFont = Font.system(.caption, design: .monospaced)
317317

318-
// MARK: - Spacing
318+
// - Spacing
319319

320320
static let defaultSpacing: CGFloat = 16
321321
static let compactSpacing: CGFloat = 8

iosApp/iosApp/Common/Performance/PerformanceMonitorDebugger.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class PerformanceMonitorDebugger {
1515

1616
private init() {}
1717

18-
// MARK: - 系统信息检查
18+
// - 系统信息检查
1919

2020
func checkSystemCapabilities() {
2121
FlareLog.performance("=== Performance Monitor System Check ===")
@@ -67,7 +67,7 @@ class PerformanceMonitorDebugger {
6767
FlareLog.performance("Frame rate monitoring test: \(canMonitorFrameRate ? "✅ Working" : "❌ Failed")")
6868
}
6969

70-
// MARK: - 性能监控组件测试
70+
// - 性能监控组件测试
7171

7272
private func testCPUMonitoring() -> Double {
7373
var threadsList: thread_act_array_t?
@@ -130,7 +130,7 @@ class PerformanceMonitorDebugger {
130130
// 空实现,仅用于测试
131131
}
132132

133-
// MARK: - 性能监控器状态检查
133+
// - 性能监控器状态检查
134134

135135
func checkPerformanceMonitorState() {
136136
FlareLog.performance("=== Performance Monitor State Check ===")
@@ -146,7 +146,7 @@ class PerformanceMonitorDebugger {
146146
FlareLog.performance("=== State Check Complete ===")
147147
}
148148

149-
// MARK: - 强制性能监控测试
149+
// - 强制性能监控测试
150150

151151
func forcePerformanceMonitoringTest() {
152152
FlareLog.performance("=== Force Performance Monitoring Test ===")
@@ -180,7 +180,7 @@ class PerformanceMonitorDebugger {
180180
}
181181
}
182182

183-
// MARK: - 日志输出测试
183+
// - 日志输出测试
184184

185185
func testLogOutput() {
186186
FlareLog.performance("=== Log Output Test ===")
@@ -203,7 +203,7 @@ class PerformanceMonitorDebugger {
203203
FlareLog.performance("=== Log Output Test Complete ===")
204204
}
205205

206-
// MARK: - 完整诊断
206+
// - 完整诊断
207207

208208
func runFullDiagnostic() {
209209
FlareLog.performance("🔍 === PERFORMANCE MONITOR FULL DIAGNOSTIC ===")
@@ -217,7 +217,7 @@ class PerformanceMonitorDebugger {
217217
}
218218
}
219219

220-
// MARK: - OSLog Extension for Debug
220+
// - OSLog Extension for Debug
221221

222222
extension OSLog {
223223
static let debug = OSLog(subsystem: "dev.dimension.flare", category: "debug")

iosApp/iosApp/Common/Performance/PerformanceTestConfig.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import Foundation
22
import SwiftUI
33

4-
// MARK: - Performance Test Configuration
4+
// - Performance Test Configuration
55

66
/// 性能测试配置类,用于控制不同优化功能的开启/关闭
77
/// Performance test configuration class for controlling different optimization features
88
@Observable
99
class PerformanceTestConfig {
1010
static let shared = PerformanceTestConfig()
1111

12-
// MARK: - Optimization Feature Toggles
12+
// - Optimization Feature Toggles
1313

1414
/// Task 1.1: 稳定 ID 系统优化
1515
/// Task 1.1: Stable ID system optimization
@@ -23,7 +23,7 @@ class PerformanceTestConfig {
2323
/// Task 1.3: Visible range detection optimization
2424
var enableVisibleRangeDetection: Bool = true
2525

26-
// MARK: - Test Scenarios
26+
// - Test Scenarios
2727

2828
/// 当前测试场景
2929
/// Current test scenario
@@ -51,7 +51,7 @@ class PerformanceTestConfig {
5151
}
5252
}
5353

54-
// MARK: - Test Configuration
54+
// - Test Configuration
5555

5656
/// 是否正在进行性能测试
5757
/// Whether performance testing is in progress
@@ -101,7 +101,7 @@ class PerformanceTestConfig {
101101
}
102102
}
103103

104-
// MARK: - Test Results
104+
// - Test Results
105105

106106
/// 测试结果存储
107107
/// Test results storage
@@ -131,7 +131,7 @@ class PerformanceTestConfig {
131131
}
132132
}
133133

134-
// MARK: - Configuration Methods
134+
// - Configuration Methods
135135

136136
/// 应用测试场景配置
137137
/// Apply test scenario configuration

0 commit comments

Comments
 (0)