From a4c5890147378613d1a2c5f3ffd2750daebcade8 Mon Sep 17 00:00:00 2001 From: Garth Vander Houwen Date: Sun, 23 Jun 2024 06:05:25 -0700 Subject: [PATCH] Revert "Log cleanup" This reverts commit a4e26de6e5423ddeb70d40388d80690006f21bb1. revert log changes --- Meshtastic/Views/Helpers/LogDetail.swift | 50 +++++++------------ .../Nodes/Helpers/Map/NodeMapSwiftUI.swift | 11 ++-- en.lproj/Localizable.strings | 2 +- 3 files changed, 23 insertions(+), 40 deletions(-) diff --git a/Meshtastic/Views/Helpers/LogDetail.swift b/Meshtastic/Views/Helpers/LogDetail.swift index 2fab990b..69cf87a2 100644 --- a/Meshtastic/Views/Helpers/LogDetail.swift +++ b/Meshtastic/Views/Helpers/LogDetail.swift @@ -15,16 +15,6 @@ struct LogDetail: View { @Environment(\.dismiss) private var dismiss private var idiom: UIUserInterfaceIdiom { UIDevice.current.userInterfaceIdiom } var log: OSLogEntryLog - var font: Font = .title2 - - private let dateFormatStyle = Date.FormatStyle() - .day(.defaultDigits) - .month(.defaultDigits) - .year(.twoDigits) - .hour(.twoDigits(amPM: .abbreviated)) - .minute() - .second() - .secondFraction(.fractional(3)) var body: some View { @@ -40,10 +30,9 @@ struct LogDetail: View { /// Time Label { Text("log.time".localized + ":") - .font(idiom == .phone ? .caption : .title) - .frame(width: idiom == .phone ? 90 : 190, alignment: .trailing) - Text(log.date.formatted(dateFormatStyle)) - .font(idiom == .phone ? .caption : .title) + .font(idiom == .phone ? .callout : .title) + LastHeardText(lastHeard: log.date) + .font(idiom == .phone ? .callout : .title) } icon: { Image(systemName: "timer") .symbolRenderingMode(.hierarchical) @@ -56,14 +45,13 @@ struct LogDetail: View { /// Subsystem Label { Text("log.subsystem".localized + ":") - .font(idiom == .phone ? .caption : .title) - .frame(width: idiom == .phone ? 90 : 190, alignment: .trailing) + .font(idiom == .phone ? .callout : .title) Text(log.subsystem) - .font(idiom == .phone ? .caption : .title) + .font(idiom == .phone ? .callout : .title) } icon: { Image(systemName: "gear") .symbolRenderingMode(.hierarchical) - .font(idiom == .phone ? .caption : .title) + .font(idiom == .phone ? .callout : .title) .frame(width: 35) } .padding(.bottom, 5) @@ -71,14 +59,13 @@ struct LogDetail: View { /// Process Label { Text("log.process".localized + ":") - .font(idiom == .phone ? .caption : .title) - .frame(width: idiom == .phone ? 90 : 190, alignment: .trailing) + .font(idiom == .phone ? .callout : .title) Text(log.process) - .font(idiom == .phone ? .caption : .title) + .font(idiom == .phone ? .callout : .title) } icon: { Image(systemName: "tag") .symbolRenderingMode(.hierarchical) - .font(idiom == .phone ? .caption : .title) + .font(idiom == .phone ? .callout : .title) .frame(width: 35) } .padding(.bottom, 5) @@ -86,14 +73,13 @@ struct LogDetail: View { /// Category Label { Text("log.category".localized + ":") - .font(idiom == .phone ? .caption : .title) - .frame(width: idiom == .phone ? 90 : 190, alignment: .trailing) + .font(idiom == .phone ? .callout : .title) Text(log.category) - .font(idiom == .phone ? .caption : .title) + .font(idiom == .phone ? .callout : .title) } icon: { Image(systemName: "square.grid.2x2") .symbolRenderingMode(.hierarchical) - .font(idiom == .phone ? .caption : .title) + .font(idiom == .phone ? .callout : .title) .frame(width: 35) } .padding(.bottom, 5) @@ -101,14 +87,13 @@ struct LogDetail: View { /// Level Label { Text("log.level".localized + ":") - .font(idiom == .phone ? .caption : .title) - .frame(width: idiom == .phone ? 90 : 190, alignment: .trailing) + .font(idiom == .phone ? .callout : .title) Text(log.level.description) - .font(idiom == .phone ? .caption : .title) + .font(idiom == .phone ? .callout : .title) } icon: { Image(systemName: "stairs") .symbolRenderingMode(.hierarchical) - .font(idiom == .phone ? .caption : .title) + .font(idiom == .phone ? .callout : .title) .frame(width: 35) } .padding(.bottom, 5) @@ -116,11 +101,10 @@ struct LogDetail: View { /// message Label { Text("log.message".localized + ":") - .font(idiom == .phone ? .caption : .title) - .frame(width: idiom == .phone ? 90 : 190, alignment: .trailing) + .font(idiom == .phone ? .callout : .title) Text(log.composedMessage) .textSelection(.enabled) - .font(idiom == .phone ? .body : .title) + .font(idiom == .phone ? .callout : .title) .padding(.bottom, 5) } icon: { diff --git a/Meshtastic/Views/Nodes/Helpers/Map/NodeMapSwiftUI.swift b/Meshtastic/Views/Nodes/Helpers/Map/NodeMapSwiftUI.swift index c86e1fa6..27f6b7e6 100644 --- a/Meshtastic/Views/Nodes/Helpers/Map/NodeMapSwiftUI.swift +++ b/Meshtastic/Views/Nodes/Helpers/Map/NodeMapSwiftUI.swift @@ -210,11 +210,6 @@ struct NodeMapSwiftUI: View { private func setupMapView() { UIApplication.shared.isIdleTimerDisabled = true - if let coordinate = mostRecent?.coordinate { - position = .camera(MapCamera(centerCoordinate: coordinate, distance: 12000, heading: 0, pitch: 60)) - } else { - position = .automatic - } switch selectedMapLayer { case .standard: mapStyle = MapStyle.standard(elevation: .flat, pointsOfInterest: showPointsOfInterest ? .all : .excludingAll, showsTraffic: showTraffic) @@ -225,7 +220,11 @@ struct NodeMapSwiftUI: View { case .offline: mapStyle = MapStyle.hybrid(elevation: .flat, pointsOfInterest: showPointsOfInterest ? .all : .excludingAll, showsTraffic: showTraffic) } - + if node.positions?.count ?? 0 > 1 { + position = .automatic + } else if let coordinate = mostRecent?.coordinate { + position = .camera(MapCamera(centerCoordinate: coordinate, distance: 8000, heading: 0, pitch: 60)) + } if scene == nil, let coordinate = mostRecent?.coordinate { Task { scene = try await fetchScene(for: coordinate) diff --git a/en.lproj/Localizable.strings b/en.lproj/Localizable.strings index 25fab7b6..fb3af6f6 100644 --- a/en.lproj/Localizable.strings +++ b/en.lproj/Localizable.strings @@ -177,7 +177,7 @@ "interval.seventytwo.hours"="Seventy Two Hours"; "keyboard.type"="Keyboard Type"; "logging"="Logging"; -"log.time"="Timestamp"; +"log.time"="Time"; "log.subsystem"="Subsystem"; "log.process"="Process"; "log.category"="Category";