diff --git a/Meshtastic/Views/Helpers/LogDetail.swift b/Meshtastic/Views/Helpers/LogDetail.swift index 079d00f2..69cf87a2 100644 --- a/Meshtastic/Views/Helpers/LogDetail.swift +++ b/Meshtastic/Views/Helpers/LogDetail.swift @@ -40,7 +40,8 @@ struct LogDetail: View { .frame(width: 35) } .padding(.bottom, 5) - .listRowSeparator(.visible) + .listSectionSeparator(.hidden, edges: .top) + .listSectionSeparator(.visible, edges: .bottom) /// Subsystem Label { Text("log.subsystem".localized + ":") @@ -76,7 +77,7 @@ struct LogDetail: View { Text(log.category) .font(idiom == .phone ? .callout : .title) } icon: { - Image(systemName: "rectangle.3.group") + Image(systemName: "square.grid.2x2") .symbolRenderingMode(.hierarchical) .font(idiom == .phone ? .callout : .title) .frame(width: 35) @@ -101,6 +102,10 @@ struct LogDetail: View { Label { Text("log.message".localized + ":") .font(idiom == .phone ? .callout : .title) + Text(log.composedMessage) + .textSelection(.enabled) + .font(idiom == .phone ? .callout : .title) + .padding(.bottom, 5) } icon: { Image(systemName: "text.bubble") @@ -109,11 +114,10 @@ struct LogDetail: View { .frame(width: 35) } .listRowSeparator(.hidden) - Text(log.composedMessage) - .font(idiom == .phone ? .callout : .title) - .padding(.bottom, 5) + } .listStyle(.plain) + } Spacer() } @@ -131,6 +135,7 @@ struct LogDetail: View { .padding(.bottom) #endif } + .monospaced() .presentationDetents([.fraction(0.65), .fraction(0.75), .fraction(0.85)]) .presentationDragIndicator(.visible) } diff --git a/Meshtastic/Views/Settings/AppLog.swift b/Meshtastic/Views/Settings/AppLog.swift index 4feb0865..22402ce5 100644 --- a/Meshtastic/Views/Settings/AppLog.swift +++ b/Meshtastic/Views/Settings/AppLog.swift @@ -12,7 +12,7 @@ import OSLog struct AppLog: View { @State private var logs: [OSLogEntryLog] = [] - @State private var sortOrder = [KeyPathComparator(\OSLogEntryLog.date, order: .forward)] + @State private var sortOrder = [KeyPathComparator(\OSLogEntryLog.date, order: .reverse)] @State private var selection: OSLogEntry.ID? @State private var selectedLog: OSLogEntryLog? @State private var presentingErrorDetails: Bool = false @@ -41,18 +41,22 @@ struct AppLog: View { TableColumn("log.time", value: \.date) { value in Text(value.date.formatted(dateFormatStyle)) } - .width(min: 100, max: 125) + .width(min: 125, max: 150) TableColumn("log.category", value: \.category) - .width(min: 100, max: 125) + .width(min: 125, max: 150) TableColumn("log.level") { value in Text(value.level.description) } - .width(min: 50, max: 100) + .width(min: 75, max: 100) } - TableColumn("log.message", value: \.composedMessage) - .width(ideal: 200, max: .infinity) + TableColumn("log.message", value: \.composedMessage) { value in + Text(value.composedMessage) + } + .width(ideal: 200, max: .infinity) + } + .monospaced() .searchable(text: $searchTerm, placement: .navigationBarDrawer, prompt: "Search") .disabled(selection != nil) .overlay { @@ -78,6 +82,7 @@ struct AppLog: View { } .task { logs = await fetchLogs() + logs.sort(using: sortOrder) } .fileExporter( isPresented: $isExporting,