chore: remove update logs UI from preferences
Remove the Show/Hide Logs button and logs view from the Updates preferences tab. Keep the logging infrastructure in SparkleUpdater for diagnostics, but don't display it in the UI.
This commit is contained in:
@@ -10,7 +10,6 @@ final class SparkleUpdater: NSObject, ObservableObject {
|
||||
private let logger = Logger(subsystem: "net.24unix.iKeyMon", category: "Sparkle")
|
||||
private let verboseLogging: Bool
|
||||
@Published var logMessages: [String] = []
|
||||
@Published var showLogs: Bool = false
|
||||
|
||||
override init() {
|
||||
self.verboseLogging = ProcessInfo.processInfo.environment["SPARKLE_VERBOSE_LOGGING"] == "1"
|
||||
|
||||
@@ -257,64 +257,11 @@ private struct UpdatesPreferencesView: View {
|
||||
.foregroundColor(.secondary)
|
||||
.padding(.top, 4)
|
||||
|
||||
Divider()
|
||||
.padding(.vertical, 8)
|
||||
|
||||
Button(action: { sparkleUpdater.showLogs.toggle() }) {
|
||||
Label(sparkleUpdater.showLogs ? "Hide Logs" : "Show Logs", systemImage: "terminal.fill")
|
||||
}
|
||||
|
||||
if sparkleUpdater.showLogs {
|
||||
logsView
|
||||
}
|
||||
|
||||
Spacer()
|
||||
}
|
||||
.toggleStyle(.switch)
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
}
|
||||
|
||||
private var logsView: some View {
|
||||
VStack(alignment: .leading, spacing: 8) {
|
||||
Text("Update Logs")
|
||||
.font(.caption)
|
||||
.fontWeight(.semibold)
|
||||
.foregroundColor(.secondary)
|
||||
|
||||
ScrollView {
|
||||
VStack(alignment: .leading, spacing: 4) {
|
||||
if sparkleUpdater.logMessages.isEmpty {
|
||||
Text("No logs yet. Check for updates to see activity.")
|
||||
.font(.caption)
|
||||
.foregroundColor(.secondary)
|
||||
.italic()
|
||||
} else {
|
||||
ForEach(sparkleUpdater.logMessages, id: \.self) { message in
|
||||
Text(message)
|
||||
.font(.caption)
|
||||
.foregroundColor(.secondary)
|
||||
.lineLimit(3)
|
||||
.textSelection(.enabled)
|
||||
}
|
||||
}
|
||||
}
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
.padding(8)
|
||||
}
|
||||
.frame(height: 200)
|
||||
.background(Color(nsColor: .controlBackgroundColor))
|
||||
.cornerRadius(6)
|
||||
.border(.separator, width: 1)
|
||||
|
||||
Button(action: {
|
||||
sparkleUpdater.logMessages.removeAll()
|
||||
}) {
|
||||
Label("Clear Logs", systemImage: "trash")
|
||||
.font(.caption)
|
||||
}
|
||||
.disabled(sparkleUpdater.logMessages.isEmpty)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private struct NotificationsPreferencesView: View {
|
||||
|
||||
Reference in New Issue
Block a user