From 5f99c5cc32d6998e71795a662819b50521620e29 Mon Sep 17 00:00:00 2001 From: neoarz <164915254+neoarz@users.noreply.github.com> Date: Sat, 29 Mar 2025 11:16:19 -0400 Subject: [PATCH] Update ConsoleLogsView.swift --- StikJIT/Views/ConsoleLogsView.swift | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/StikJIT/Views/ConsoleLogsView.swift b/StikJIT/Views/ConsoleLogsView.swift index 6fdd331..fe7d123 100644 --- a/StikJIT/Views/ConsoleLogsView.swift +++ b/StikJIT/Views/ConsoleLogsView.swift @@ -21,11 +21,11 @@ struct ConsoleLogsView: View { .edgesIgnoringSafeArea(.all) VStack(spacing: 0) { - // Terminal-style logs area + // Terminal logs area (made it look somewhat like feathers implementation) ScrollViewReader { proxy in ScrollView { VStack(spacing: 0) { - // Device Information + // Device Information (all thw way on top) ForEach(["Version: \(UIDevice.current.systemVersion)", "Name: \(UIDevice.current.name)", "Model: \(UIDevice.current.model)", @@ -40,7 +40,7 @@ struct ConsoleLogsView: View { Spacer() - // Log entries with terminal-style alignment (no indentation on wrapped lines) + // Log entries ForEach(logManager.logs) { logEntry in Text(AttributedString(createLogAttributedString(logEntry))) .font(.system(size: 11, design: .monospaced)) @@ -66,7 +66,7 @@ struct ConsoleLogsView: View { Spacer() - // Bottom section with error count and action buttons + VStack(spacing: 16) { // Error count with red theme HStack { @@ -82,7 +82,7 @@ struct ConsoleLogsView: View { // Action buttons with dark background VStack(spacing: 1) { - // Share button + Button(action: { let logs = logManager.logs.map { "[\(formatTime(date: $0.timestamp))] [\($0.type.rawValue)] \($0.message)" }.joined(separator: "\n") @@ -188,8 +188,7 @@ struct ConsoleLogsView: View { .navigationViewStyle(StackNavigationViewStyle()) } - // Creates an NSAttributedString that combines timestamp, type, and message - // with proper styling for each component + private func createLogAttributedString(_ logEntry: LogManager.LogEntry) -> NSAttributedString { let fullString = NSMutableAttributedString() @@ -251,9 +250,9 @@ struct ConsoleLogsView: View { } } -// Preview provider + struct ConsoleLogsView_Previews: PreviewProvider { static var previews: some View { ConsoleLogsView() } -} \ No newline at end of file +}